• Thanks for posting this, I used to have something very similar that has one more for loop to read servers from a text file. Here is my stab at it the powershell way:

    #drspacev2.ps1

    #Iterate a list of servers (src:a text file in d:\ps_scripts\servers.txt) through the WMI interface in windows.

    #Collect a list of stats on all local drives for each server and store data

    #in a csv file pipe"|" delimited at c:\temp\freespace.csv

    New-Item c:\temp\Freespace.csv -type file -force | out-null;

    $srvr = Get-Content C:\Temp\Servers.txt; foreach($row in $srvr) {

    Get-WMIObject Win32_LogicalDisk -filter "DriveType=3" -computer $row| Select SystemName,DeviceID,VolumeName,size,freespace | foreach{$_.DeviceID}{$row+"|"+$_.DeviceID+"|"+$_.size/1mb+"|"+$_.freespace/1mb+"|FileSpace"|add-content c:\temp\Freespace.csv}}

    This will iterate a text file named "Servers.txt" and grab all the freespace for "FIXED" drives, for each server in the text file. I even took this another step further creating a FormatFile, importing the data, and creating a conditionalized "Freespace" report in SSRS. (Conditionalized meaning the cells are colored red, lt. yellow, and blue depending on the amount of free space.) If anyone is interested I can write this up. Thanks again for your script aditya!