SQLvariations: SQL Server, a little PowerShell, maybe some Hyper-V Rotating Header Image

quick post checking mount points with PowerShell

Having problems with my blog feed so this is just a temporary post.  I hope to get things fixed this weekend.  Does anyone know how to fix a blog feed that is bigger than 512k?

This code here will loop through a list of servers that you supply it in a text file and then spit out only the Mount Points on those servers that have less than 20% free space remaining on them.

foreach ($svr in get-content "C:\PowerShell\AllServers.txt")             

{             

$svr; Get-WmiObject Win32_PerfFormattedData_PerfDisk_LogicalDisk -ComputerName $svr `
| where{$_.Name -ne "_Total" -and $_.PercentFreeSpace -lt 20} | select-object Name, PercentFreeSpace | format-list            

}

One Comment

  1. [...] priorities for the week.  I already have some code for checking both regular disk drives and mount points with PowerShell but I was looking to improve it and get it ready for production [...]

  2. [...] This post was mentioned on Twitter by Jorge Segarra, Aaron Nelson. Aaron Nelson said: New blog post: http://tinyurl.com/2cg6ban – quick post checking mount points with PowerShell [...]