PowerShell: Get Monitor Information
Need to check monitor details - manufacturer, model, and serial number - all at once, for asset tracking or hardware inventory? This script pulls it from the display driver and decodes it into one clean, readable output.
Prerequisites:
- Privileges: None
- Module: Built-in, no import needed
Quick Command:
function Convert-MonitorProperty {
param($Property)
($Property | Where-Object { $_ -ne 0 } | ForEach-Object { [char]$_ }) -join ""
}
$monitor = Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorID
[PSCustomObject]@{
Manufacturer = Convert-MonitorProperty $monitor.ManufacturerName
Model = Convert-MonitorProperty $monitor.UserFriendlyName
SerialNumber = Convert-MonitorProperty $monitor.SerialNumberID
}
Example Output:
Manufacturer Model SerialNumber
------------ ----- ------------
AOC Q27G4 1O0R1HA011161
📦
Want all of them at once?
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.
How It Works:
- Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorID queries monitor identification data - this lives in the root\wmi namespace (driver-supplied hardware telemetry), separate from the standard root\cimv2 namespace used by most other hardware queries.
- All three properties (ManufacturerName, UserFriendlyName, SerialNumberID) come back as arrays of ASCII character codes rather than readable text, since this data originates from the monitor's raw EDID information.
- Instead of repeating the same decode logic three times, function Convert-MonitorProperty { ... } wraps it into a small, reusable function - write the logic once, call it as many times as needed.
- param($Property) defines the function's input - whatever array of numbers gets passed in when the function is called.
- Inside the function, Where-Object { $_ -ne 0 } strips padding zeros, ForEach-Object { [char]$_ } converts each number to its character, and -join "" combines them into a single string - same decoding logic as the serial number article.
- [PSCustomObject]@{ ... } builds a custom object with clean, named columns instead of running three separate commands with three separate outputs - Manufacturer, Model, and SerialNumber each call the function once, passing in the relevant raw property.