How to get serial numbers of monitors from remote computers


  • Hi everyone,

    I am new to scripting and just started to use PowerShell.  I tried to get get serial numbers of monitors from remote computers and tried the following line on my own PC but get a message said, "Get-Wmiobject : Invalid Class".

    The code that I used is

    $trComputer = "."
    $collection = get-wmiobject -class "WinMonitorID" -namespace "root\WMI -computername $trComputer

    I found this class from the WMI Reference but I cannot not see it in the WMI Object Browser.

    Kind Regards
    Wednesday, June 17, 2009 4:04 AM


All replies

  • You must have got the class name wrong. Where in the reference did you find WinMonitorID?
    You also miss the closing quotes around root\WMI. I suspect root\WMI is wrong too. Most hardware related classes are found in the root\cimv2 namespace.
    Wednesday, June 17, 2009 7:25 AM
  • It is actually WmiMonitorID and I beleive it is available on Vista and above (PowerShell v2 solution):

    PS > $monitor = gwmi WmiMonitorID -Namespace root\wmi
    PS > ($monitor.ManufacturerName -notmatch 0 | foreach {[char]$_}) -join ""

    PS > ($monitor.UserFriendlyName -notmatch 0 | foreach {[char]$_}) -join ""

    PS > ($monitor.SerialNumberID -notmatch 0 | foreach {[char]$_}) -join ""

    Shay Levy [MVP]
    PowerShell Toolbar
    Wednesday, June 17, 2009 1:24 PM
  • Nice, i didn't know about that one. 
    Any experiences about it? How well does it work? I mean how many monitors supply this information?
    Wednesday, June 17, 2009 1:28 PM
  • Many thanks for all the messages.  I will try it out and let you know.
    Thursday, June 18, 2009 1:11 AM
  • Hi,

    I am sorry for not getting back to this for a while.

    I did found out that this class is not available on XP and I have to work with XP for the moment.  I try this on Windows 7 and it works.  Many thanks
    Monday, August 31, 2009 4:20 AM
  • There is a way to get Monitor Serial Numbers in XP (it's not pretty, but it involves using remote registry, and parsing a binary registry value)  I just posted a script that will do this on my blog:

    Tuesday, August 10, 2010 5:05 PM
  • Many thanks Trenton.ivey

    I actually found a VB script that was written by Michael Baird and had rewritten it in Powershell that does that same job as the Monitor Serial Numbers (registry) part in your script.

    I like your script and trying to learn how to use the data objects.


    Kind regards


    Wednesday, August 11, 2010 2:20 AM
  • Nice!

    For multiple monitors:

    gwmi WmiMonitorID -Namespace root\wmi | ForEach-Object {($_.UserFriendlyName -notmatch 0 | foreach {[char]$_}) -join ""; ($_.SerialNumberID -notmatch 0 | foreach {[char]$_}) -join ""}

    DELL 007W
    DELL 1905

    Wednesday, August 11, 2010 2:07 PM
  • Many thanks for this.

    For getting monitor serial numbers, it is much easier on Windows Vista and later than on XP.

    Thursday, August 12, 2010 12:36 AM
  • Hey there,
    Recently i had a task related to "Dell monitors" and getting the Serial Number,..

    i used all that i know, i asked DELL:

    the problem is: Dell monitors have a serial that is incomplete in windows:

    1. the written serial on Device:
    2. the serial retrived from registry/wmi/cim,...:

    The "72872" is related to:  Factory ID 

    CN = China
    0FFXD = Dell part number
    74261 = Factory ID (confidential)
    3AB = Date code (October 11, 2013)
    1KFS = Manufacturer code (confidential)

    Is there somone who had the same problem or know where i ken get that info?

    Monday, November 02, 2015 11:19 AM
  • Hi Calin,

    I was wondering if you ever found a solution for the above issue? I've noticed the same issue.

    Kind regards,


    Tuesday, February 16, 2016 8:09 AM
  • Hi Thomas,

    Yes, there is a solution to this problem. It is simple, the check is

    $_.UserFriendlyName -notmatch 0

    This is always true as long as the decimal number contains a 0. The intention of this check is to remove the leading and trailing Zeros. This has to be changed to

    $_.UserFriendlyName -ne 0

    It worked for me. And now I use this one.

    $Monitor = gwmi wmimonitorid -namespace root\wmi -ComputerName workstation
    $Monitor | %{
        $psObject = New-Object PSObject
        $psObject | Add-Member NoteProperty SerialNumber ""
        $psObject | Add-Member NoteProperty Name ""
        $psObject | Add-Member NoteProperty WorkstationName ""
        $psObject.SerialNumber = ($_.SerialNumberID -ne 0 | %{[char]$_}) -join ""
        $psObject.Name = ($_.UserFriendlyName -ne 0 | %{[char]$_}) -join ""
        $psObject.WorkstationName = $_.PSComputerName
    } | Out-GridView

    Best regards


    • Edited by Laîss Tuesday, January 24, 2017 4:47 PM Code updated, as there was an error
    Tuesday, January 24, 2017 4:45 PM