Skip to content

Instantly share code, notes, and snippets.

@arifams
Forked from spitfire05/Get-ScreenServiceTags.ps1
Created January 25, 2024 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arifams/24d27771e397ab4a762f4a37cf44d1ed to your computer and use it in GitHub Desktop.
Save arifams/24d27771e397ab4a762f4a37cf44d1ed 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