Hi experts.
I have csv file with more than 100 servers it contans the servername,servertype,platform
| Server | ServerType | Platform |
| test1 | terminalserver | terminal |
| test2 | tts | use |
I want to pull out the servers which have less than 10% free space.
Importing the server names from the fist column.
Get-WMIObject -ComputerName $hostname Win32_LogicalDisk | Where-Object {$_.drivetype -eq 3 -and [decimal]$_.size -gt [decimal]$thr} | select __SERVER, DriveType, VolumeName, Name, @{n='Size (Gb)' ;e={"{0:n2}" -f ($_.size/1gb)}},@{n='FreeSpace (Gb)';e={"{0:n2}" -f ($_.freespace/1gb)}}, @{n='PercentFree';e={"{0:n2}" -f ($_.freespace/$_.size*100)}},@{n='Servertype';e={"{0:n2}" -f (Import-Csv .\peer.csv | ? {$_.server -eq "$_.__SERVER"} | select -ExpandProperty "Server Type" )}} | Where-Object {[decimal]$_.PercentFree -lt [decimal]$thresholdspace}
the out put should be
servername servertype platform diskspace freepercent
test1 termianl test 50 5