PowerShell: Get Monitor Serial Number
Need to check a monitor's serial number - for asset tracking, warranty lookups, or hardware inventory? This one-liner pulls it from the display driver and decodes it into readable text.
Prerequisites:
- Privileges: None
- Module: Built-in, no import needed
Quick Command:
$monitor = Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorID
($monitor.SerialNumberID | Where-Object { $_ -ne 0 } | ForEach-Object { [char]$_ }) -join ""
Example Output:
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 - unlike most hardware info covered so far, this lives in the root\wmi namespace, which holds driver-supplied hardware telemetry (like EDID data sent by the display), separate from the standard root\cimv2 namespace.
- SerialNumberID doesn't return readable text directly - it comes back as an array of numbers (ASCII character codes), often padded with trailing zeros to a fixed length.
- Where-Object { $_ -ne 0 } strips out those padding zeros, since they aren't valid characters.
- ForEach-Object { [char]$_ } converts each remaining number into its corresponding character (e.g. 49 becomes "1", 79 becomes "O").
- -join "" combines all the individual characters back into a single readable string.