Easy way to monitor disk space on multiple MS 2003 servers

From http://technet.microsoft.com/en-us/magazine/cc137791.aspx: create a file C:\Computers.txt with the names of the machines you wish to check, then execute this PowerShell script:

Get-Content C:\Computers.txt | 
ForEach-Object { 
  $_; Get-WMIObject –computername $_ 
  Win32_LogicalDisk -filter "DriveType=3" |
  ForEach-Object { 
    $_.DeviceID; $_.FreeSpace/1GB
  }
}

You may wish to re-format that; it's pretty ugly, but works ;)

Edit: of course, you'll need to have appropriate security privileges to query other machines.


Your answer lies in Powershell but I lack the programming knowledge in that language to give you an exact solution


I think it depends on what you're using for a monitoring system. Nagios has NSC++, you can always setup a Windows based snmpd, and various commercial monitoring software packages provide other agents for you to install.

Do you have a monitoring system up and running yet, or is that what your goal is?