Last active
April 15, 2020 00:54
-
-
Save IAmStoxe/b3ed9b9ebb131838d5922dd1e393f764 to your computer and use it in GitHub Desktop.
List Hard Disk Information on Remote Computers within a Domain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $creds = Get-Credential | |
| $serverListPath = "C:\tmp\PhysicalHosts.txt" | |
| Get-WmiObject win32_diskdrive -Credential $creds -Computer (Get-Content $serverListPath) | | |
| Where-Object MediaType -eq 'Fixed hard disk media' | | |
| Select-Object SystemName, Model, @{Name = 'Size(GB)'; Exp = { $_.Size / 1gb -as [int] } } | | |
| Export-CSV "C:\tmp\disks.csv" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment