SoftPerfect Network Scanner
How to get monitor model and serial number via WMI query or class
Started by Shivakumar
Shivakumar
How to get monitor model and serial number via WMI query or class 21 June 2018, 17:48 |
Re: How to get monitor model and serial number via WMI query or class 21 June 2018, 17:57 |
Admin Registered: 12 years ago Posts: 5 643 |
You could use the following queries in the root\WMI namespace:
For human-readable format use the following VB script under Options - Remote Scripting. It will extract the byte arrays for model name and serial number and convert them to ASCII strings:
Output example:
SELECT UserFriendlyName FROM WmiMonitorID SELECT SerialNumberID FROM WmiMonitorIDHowever those are byte arrays and will be displayed as [XX, XX, XX, XX, ...].
For human-readable format use the following VB script under Options - Remote Scripting. It will extract the byte arrays for model name and serial number and convert them to ASCII strings:
'Input parameters strComputer = Input.Current 'Get monitors with WMI Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\WMI") Set colMonitors = objWMIService. _ ExecQuery("SELECT * FROM WmiMonitorID") For Each objMonitor in colMonitors 'Convert serial number to ASCII SerialNo = "" For I = 0 To Ubound(objMonitor.SerialNumberID) SerialNo = SerialNo & Chr(objMonitor.SerialNumberID(I)) Next 'Convert model name to ASCII ProductId = "" For I = 0 To Ubound(objMonitor.UserFriendlyName) ProductId = ProductId & Chr(objMonitor.UserFriendlyName(I)) Next Output.Write ProductId & " " & SerialNo Next
Output example:
Shivakumar Totad
Re: How to get monitor model and serial number via WMI query or class 23 June 2018, 16:16 |
Re: How to get monitor model and serial number via WMI query or class 23 June 2018, 18:03 |
Admin Registered: 12 years ago Posts: 5 643 |