Sometimes I feel the need to do a small inventory.
In this case, the need to do that with monitors found itself to the upper corners of my cranium.
I wanted to get the manufacturer and model. Remembering that many customers also like a serial number in their CMDBs, I put that in there too
So while waiting for another customer, I wrote this little thing:
$ComputerName = 'MTHSPC01','MTHSPC02','MTHSPC03' Get-CimInstance -Namespace root\wmi -ClassName wmimonitorid -ComputerName $ComputerName | foreach { New-Object -TypeName psobject -Property @{ Manufacturer = ($_.ManufacturerName -notmatch '^0$' | foreach {[char]$_}) -join "" Name = ($_.UserFriendlyName -notmatch '^0$' | foreach {[char]$_}) -join "" Serial = ($_.SerialNumberID -notmatch '^0$' | foreach {[char]$_}) -join "" } }
Hope you find it useful