WMIMonitorID, Convert the userfriedlyname column to human readable format

%3CLINGO-SUB%20id%3D%22lingo-sub-1552729%22%20slang%3D%22en-US%22%3EWMIMonitorID%2C%20Convert%20the%20userfriedlyname%20column%20to%20human%20readable%20format%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1552729%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20create%20a%20query%20to%20obtain%20the%20MonitorID%20WMI%20data.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20issue%20is%20that%20the%20userfriedlyname%20column%20is%20sometimes%20stored%20as%20ASCII%20values.%20How%20do%20i%20convert%20this%20to%20human%20readable%20format.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ehere%20is%20the%20current%20query%20statement%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eselect%20SMS_R_System.Name%2C%20SMS_R_System.SerialNumber%2C%20SMS_R_System.LastLogonUserName%2C%20SMS_G_System_SYSTEM_ENCLOSURE.Tag%2C%20SMS_G_System_WMIMONITORID.ManufacturerName%2C%20SMS_G_System_WMIMONITORID.UserFriendlyName%2C%20SMS_G_System_WMIMONITORID.SerialNumberID%2C%20SMS_G_System_WMIMONITORID.ProductCodeID%2C%20SMS_G_System_WMIMONITORID.UserFriendlyNameLength%2C%20SMS_G_System_WMIMONITORID.YearOfManufacture%2C%20SMS_G_System_WMIMONITORID.WeekOfManufacture%2C%20SMS_G_System_WMIMONITORID.Active%2C%20SMS_G_System_WMIMONITORID.InstanceName%2C%20SMS_G_System_WMIMONITORID.TimeStamp%20from%20SMS_R_System%20inner%20join%20SMS_G_System_WMIMONITORID%20on%20SMS_G_System_WMIMONITORID.ResourceID%20%3D%20SMS_R_System.ResourceId%20inner%20join%20SMS_G_System_SYSTEM_ENCLOSURE%20on%20SMS_G_System_SYSTEM_ENCLOSURE.ResourceID%20%3D%20SMS_R_System.ResourceId%20order%20by%20SMS_R_System.Name%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENOTE%3A%20This%20is%20query%20NOT%20a%20report.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1555358%22%20slang%3D%22en-US%22%3ERe%3A%20WMIMonitorID%2C%20Convert%20the%20userfriedlyname%20column%20to%20human%20readable%20format%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1555358%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F743450%22%20target%3D%22_blank%22%3E%40WerickV%3C%2FA%3E%26nbsp%3BWhere%20are%20you%20getting%20this%20data%20from%3F%20SMS_G_System_WMIMONITORID%20is%20not%20a%20default%20hardware%20inventory%20class%2C%20so%20I'm%20guessing%20that%20you%20extended%20your%20hardware%20inventory%20to%20include%20this%20information.%20By%20default%2C%20monitor%20information%20is%20collected%20from%20the%20%22Desktop%20Monitor%22%20(Win32_DesktopMonitor)%20WMI%20class%20and%20stored%20in%20the%26nbsp%3BSMS_G_System_DESKTOP_MONITOR%20class.%20Have%20you%20tried%20using%20that%20one%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1558142%22%20slang%3D%22en-US%22%3ERe%3A%20WMIMonitorID%2C%20Convert%20the%20userfriedlyname%20column%20to%20human%20readable%20format%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1558142%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F241578%22%20target%3D%22_blank%22%3E%40Michiel%20Overweel%3C%2FA%3E%26nbsp%3BI%20enabled%20collecting%20that%20standard%20class.%20The%26nbsp%3B%3CSPAN%3EWin32_DesktopMonitor%20does%20not%20include%20manufacturer%20and%20serial%20etc.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1558417%22%20slang%3D%22en-US%22%3ERe%3A%20WMIMonitorID%2C%20Convert%20the%20userfriedlyname%20column%20to%20human%20readable%20format%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1558417%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F743450%22%20target%3D%22_blank%22%3E%40WerickV%3C%2FA%3E%26nbsp%3BSo%20I'm%20assuming%20you%20extended%20hardware%20inventory%20to%20include%20the%26nbsp%3B%3CA%20title%3D%22WmiMonitorID%20class%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fnl-nl%2Fwindows%2Fwin32%2Fwmicoreprov%2Fwmimonitorid%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EWmiMonitorID%20class%3C%2FA%3E.%20Many%20properties%20of%20that%20class%20are%20stored%20not%20as%20string%20values%2C%20but%20as%20arrays%20of%20ASCII%20character%20codes.%20If%20you%20insist%20on%20using%20the%20WmiMonitorID%20class%2C%20that's%20something%20you'll%20have%20to%20live%20with.%20I%20don't%20think%20you%20can%20convert%20these%20arrays%20to%20strings%20using%20WQL%2C%20but%20it%20should%20be%20possible%20using%20SQL.%20You%20might%20be%20interested%20in%20this%20(old)%20blog%20article%3A%26nbsp%3B%3CA%20title%3D%22Reporting%20Monitor%20information%20with%20Configuration%20Manager%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Farchive%2Fblogs%2Fkmongwa%2Freporting-monitor-information-with-configuration-manager%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EReporting%20Monitor%20information%20with%20Configuration%20Manager%3C%2FA%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hi

 

I am trying to create a query to obtain the MonitorID WMI data.

 

The issue is that the userfriedlyname column is sometimes stored as ASCII values. How do i convert this to human readable format.

 

here is the current query statement

 

select SMS_R_System.Name, SMS_R_System.SerialNumber, SMS_R_System.LastLogonUserName, SMS_G_System_SYSTEM_ENCLOSURE.Tag, SMS_G_System_WMIMONITORID.ManufacturerName, SMS_G_System_WMIMONITORID.UserFriendlyName, SMS_G_System_WMIMONITORID.SerialNumberID, SMS_G_System_WMIMONITORID.ProductCodeID, SMS_G_System_WMIMONITORID.UserFriendlyNameLength, SMS_G_System_WMIMONITORID.YearOfManufacture, SMS_G_System_WMIMONITORID.WeekOfManufacture, SMS_G_System_WMIMONITORID.Active, SMS_G_System_WMIMONITORID.InstanceName, SMS_G_System_WMIMONITORID.TimeStamp from SMS_R_System inner join SMS_G_System_WMIMONITORID on SMS_G_System_WMIMONITORID.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_SYSTEM_ENCLOSURE on SMS_G_System_SYSTEM_ENCLOSURE.ResourceID = SMS_R_System.ResourceId order by SMS_R_System.Name

 

 

NOTE: This is query NOT a report.

 

 

Thanks

 

 

 

3 Replies
Highlighted

@WerickV Where are you getting this data from? SMS_G_System_WMIMONITORID is not a default hardware inventory class, so I'm guessing that you extended your hardware inventory to include this information. By default, monitor information is collected from the "Desktop Monitor" (Win32_DesktopMonitor) WMI class and stored in the SMS_G_System_DESKTOP_MONITOR class. Have you tried using that one?

Highlighted

@Michiel Overweel I enabled collecting that standard class. The Win32_DesktopMonitor does not include manufacturer and serial etc.

 

Highlighted

@WerickV So I'm assuming you extended hardware inventory to include the WmiMonitorID class. Many properties of that class are stored not as string values, but as arrays of ASCII character codes. If you insist on using the WmiMonitorID class, that's something you'll have to live with. I don't think you can convert these arrays to strings using WQL, but it should be possible using SQL. You might be interested in this (old) blog article: Reporting Monitor information with Configuration Manager.