Notice the name of the resultset ( Report.DiskSpaceInfo). Write-Output $obj Type Name Of The Resultset Objects $obj = New-Object -TypeName PSObject -Property $properties Get-CimInstance -Class CIM_LogicalDisk -ComputerName (Get-Content -Path 'C:\Temp\Servers.txt') | Select-Object Space(GB)" Expression= We use the CIM_LogicalDisk CIM Class combined with the ComputerName parameter that has been fed from the text file with the list of servers. We basically load the content of the text file using Get-Content CmdLet and PowerShell will go through the list and run the same command as in the previous solution for each server on the list. Properties of Win32_LogicalDisk WMI Class Solution 2 – Get Disk Size And Disk Free Space For The List Of Servers (Remote Computers)įor the list of computers, we can use the same calls as for the previous solution only to use the ComputerName parameter and add the list of servers as a txt file.Ĭreate the list of servers in the text file and save in, for example, C:\Temp folder.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |