Quantcast
Channel: Microsoft – JeffOps
Viewing all articles
Browse latest Browse all 120

PowerShell – Find the manufacturer, model and serial for your monitors

$
0
0

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 🙂


Viewing all articles
Browse latest Browse all 120

Trending Articles