Skip to content

Instantly share code, notes, and snippets.

@spitfire05
Created March 12, 2020 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save spitfire05/5f40d291c646c41128c673baf2bbe9f4 to your computer and use it in GitHub Desktop.
Save spitfire05/5f40d291c646c41128c673baf2bbe9f4 to your computer and use it in GitHub Desktop.
Get serial number of connected screens with Powershell
$Monitors = Get-WmiObject WmiMonitorID -Namespace root\wmi
ForEach ($Monitor in $Monitors)
{
    $Manufacturer = ($Monitor.ManufacturerName -notmatch 0 | ForEach{[char]$_}) -join ""
    $Name = ($Monitor.UserFriendlyName -notmatch 0 | ForEach{[char]$_}) -join ""
    $Serial = ($Monitor.SerialNumberID -notmatch 0 | ForEach{[char]$_}) -join ""
   
    "$Manufacturer,$Name,$Serial"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment