Skip to content

Instantly share code, notes, and snippets.

@royashbrook
Created February 7, 2018 16:21
Show Gist options
  • Save royashbrook/eda182f4217f2656001c24de0210752a to your computer and use it in GitHub Desktop.
Save royashbrook/eda182f4217f2656001c24de0210752a to your computer and use it in GitHub Desktop.
##Inventory a list of machines:
"server1","server2" | % {
$c = $_ #var to hold computer name
$o = @() #hashtable to hold results
$o += Get-WmiObject -ComputerName $c -Class Win32_OperatingSystem
$o += Get-WmiObject -ComputerName $c -Class Win32_BIOS
$o += Get-WmiObject -ComputerName $c -Class Win32_ComputerSystem
$o += Get-WmiObject -ComputerName $c -Class Win32_Processor
$o += Get-WmiObject -ComputerName $c -Class Win32_LogicalDisk | Where-Object {$_.DriveType -eq 3}
$o
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment