Topic
  • 23 replies
  • Latest Post - ‏2014-06-26T19:58:49Z by castillo0218
samuel7791
samuel7791
6 Posts

Pinned topic Monitor Serial Number

‏2007-11-28T04:06:28Z |
Is there any method to get serial numbers of monitors into bigfix?

Thanks,
Samuel
Updated on 2011-12-29T19:23:04Z at 2011-12-29T19:23:04Z by BenKus
  • BenKus
    BenKus
    399 Posts

    Re: Monitor Serial Number

    ‏2007-11-29T06:37:16Z  
    Hi Samuel,

    I researched this for a while and I found some cool stuff... based on the results, I made a relevance query that returns model number, serial number, and date manufactured of each monitor:


    q: ((if (exists first "000000fc00" of it) then hexadecimal string (first 24 of following texts of first "000000fc00" of it ) else "n/a"), (if (exists first "000000ff00" of it) then hexadecimal string (first 24 of following texts of first "000000ff00" of it ) else "n/a"), (hexadecimal integer (first 2 of following text of position 32 of it )/4) as string & "/" & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) of (values "EDID" of keys (("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\" & it & "\Device Parameters") of (string values of selects "PNPDeviceID from Win32_DesktopMonitor" of wmi) ) of registry as string)
    A: DELL 2001FP, C06465381C7L, 2/2005


    Couple notes:
    • Not all computers have serial numbers (laptops don't seem to have them)
    • I have only tested this on a couple computers
    • if you want just the model number add a item 0 of to the beginning of the relevance above, for only serial number add item 1 of, and for only date, add item 2 of

    Let me know if this seems to work for you...
    Ben
  • SystemAdmin
    SystemAdmin
    562 Posts

    Re: Monitor Serial Number

    ‏2009-08-05T19:21:15Z  
    Ben,

    Could this be added to the default Hardware Information Analyses (feature request)? And is there a way to grab it for OSX and Linux?

    john
  • SystemAdmin
    SystemAdmin
    562 Posts

    Re: Monitor Serial Number

    ‏2009-08-06T23:57:41Z  
    It appears the thread here answers my mac osx question - http://forum.bigfix.com/viewtopic.php?id=2266

    I'd also like to request that this be added to the Hardware Information Analyses for Windows, Mac and Linux.
  • NoahSalzman
    NoahSalzman
    42 Posts

    Re: Monitor Serial Number

    ‏2009-08-07T16:56:58Z  
    You can get monitor details out of Mac OS X -- using the command "system_profiler SPDisplaysDataType" -- but it does not include the serial number.
  • SystemAdmin
    SystemAdmin
    562 Posts

    Re: Monitor Serial Number

    ‏2010-02-10T03:24:20Z  
    Ben,

    A good percent of our systems are showing %0a at the end of the make and / or model. Is there a way to filter that? Some systems are showing the same monitor info twice under <multiple results>. Others are showing eithe <error> or <multiple results, error>. Dual monitor systems are only showing one monitor on a multi monitor system.

    Noah,

    I tried to utilize the relevance in the thread that I linked here but seem to get back <error> on my os x test machine. I have not tried the method you suggested because quite frankly I have zero knowledge of os x at this point in time. Could you elaborate on your method a little more?
  • NoahSalzman
    NoahSalzman
    42 Posts

    Re: Monitor Serial Number

    ‏2010-02-10T19:39:24Z  
    This is what the output looks like on my Mac. Before donating some ActionScript/Relevance to this thread, my questions to you would be:

    • Do you just want the display name ("DELL 2007FP") or other tid-bits as well? Resolution?
    • In the case of an external display do you want both display names or just the external?
    $ system_profiler SPDisplaysDataType
    Graphics/Displays:

    ATI Radeon X1600:

    Chipset Model: ATY,RadeonX1600
    Type: GPU
    Bus: PCIe
    PCIe Lane Width: x16
    VRAM (Total): 256 MB
    Vendor: ATI (0x1002)
    Device ID: 0x71c5
    Revision ID: 0x0000
    ROM Revision: 113-xxxxxx-158
    EFI Driver Version: 01.00.158
    Displays:
    Color LCD:
    Resolution: 1440 x 900
    Pixel Depth: 32-Bit Color (ARGB8888)
    Mirror: Off
    Online: Yes
    Built-In: Yes
    DELL 2007FP:
    Resolution: 1600 x 1200 @ 60 Hz
    Pixel Depth: 32-Bit Color (ARGB8888)
    Main Display: Yes
    Mirror: Off
    Online: Yes
    Rotation: Supported
  • SystemAdmin
    SystemAdmin
    562 Posts

    Re: Monitor Serial Number

    ‏2010-02-10T19:53:04Z  
    Noah, thanks for the willingness to donate some relevance!

    What we'd like to see is the same info we collect on the windows side. So we'd like to see the graphics cards and all monitors / lcds that are either built in or external to the system with the manufacurer, model and serial # along with the display settings.

    Ex (with your data):
    Video Controller - ATI Radeon

    Monitor Manufacturer - Built In, DELL
    Monitor Model - LCD, 2007FP
    Monitor Serial # -
    Monitor Resolution - 1440 x 900 x 32-Bit Color, 1440 x 900 x 32-Bit Color

    Does that make sense?

    John
  • NoahSalzman
    NoahSalzman
    42 Posts

    Re: Monitor Serial Number

    ‏2010-02-12T00:01:57Z  
    OK... it's not perfect, but it may get you far enough along to be satisfactory.

    First, some notes:

    There were two ways to get the System Profiler output: formatted or xml. The former is nice to read but hard to parse programatically. The latter is easy to parse using the Relevance inspector (for Mac plist's) but has the drawback that some of the strings are less "clean" than those presented in the formatted system_profiler output.

    I used the xml output for ease of parsing. Also, there is a lame sed hack in the Action Script one-liner; it makes the xml output readable by our plist inspector as it expects the top level to be "dict" not "array". That hack will break if Apple changes the output format in a future version of system_profiler.

    This should work on Mac OS X 10.4 through 10.6... haven't tried 10.3. However, if on your boxes the system_profiler utility spits out the dictionary items in a different order than what I saw on our boxes then these queries will likely fail.

    That value for the Dell serial number does not match the serial number on my monitor, so Apple may have a bug there -- this would explain why that value only exists in the xml output and is not surfaced in the formatted output.
    Your ActionScript needs to be:
    wait /bin/sh -c "system_profiler -xml SPDisplaysDataType | sed '/^<\/*array>/d' > /tmp/display_info.xml"

    Your Relevance queries for your custom properties should look like this for the first display:

    Q: string "_name" of dictionary 0 of array "spdisplays_ndrvs" of dictionary 0 of array "_items" of dictionary of file "/tmp/display_info.xml"
    A: Color LCD

    Q: string "spdisplays_resolution" of dictionary 0 of array "spdisplays_ndrvs" of dictionary 0 of array "_items" of dictionary of file "/tmp/display_info.xml"
    A: 1440 x 900

    Q: string "spdisplays_depth" of dictionary 0 of array "spdisplays_ndrvs" of dictionary 0 of array "_items" of dictionary of file "/tmp/display_info.xml"
    A: CGSThirtytwoBitColor

    For the 2nd display use "dictionary 1" of the array:

    Q: string "_name" of dictionary 1 of array "spdisplays_ndrvs" of dictionary 0 of array "_items" of dictionary of file "/tmp/display_info.xml"
    A: DELL 2007FP

    Q: string "spdisplays_resolution" of dictionary 1 of array "spdisplays_ndrvs" of dictionary 0 of array "_items" of dictionary of file "/tmp/display_info.xml"
    A: 1600 x 1200 @ 60 Hz

    Q: string "spdisplays_depth" of dictionary 1 of array "spdisplays_ndrvs" of dictionary 0 of array "_items" of dictionary of file "/tmp/display_info.xml"
    A: CGSThirtytwoBitColor

    Q: string "_spdisplays_display-serial-number" of dictionary 1 of array "spdisplays_ndrvs" of dictionary 0 of array "_items" of dictionary of file "/tmp/display_info.xml"
    A: 31313153

    And, finally, use this query if you want the GPU:

    Q: string "sppci_model" of dictionary 0 of array "_items" of dictionary of file "/tmp/display_info.xml"
    A: ATY,RadeonX1600
    Updated on 2010-02-12T00:01:57Z at 2010-02-12T00:01:57Z by NoahSalzman
  • SystemAdmin
    SystemAdmin
    562 Posts

    Re: Monitor Serial Number

    ‏2010-02-15T14:22:21Z  
    Thanks Noah. It's about 50 / 50 in terms of results. Perhaps a DSS / HAM product is on the horizon that will gather this information :)
  • NoahSalzman
    NoahSalzman
    42 Posts

    Re: Monitor Serial Number

    ‏2010-02-15T19:38:26Z  
    jspanitz
    Thanks Noah. It's about 50 / 50 in terms of results. Perhaps a DSS / HAM product is on the horizon that will gather this information :)
    Can you post the system_profiler output the xml version, please here for one of the machines that is not returning results? And, is there any correlation between OS version and "not returning results"?
    Updated on 2010-02-15T19:38:26Z at 2010-02-15T19:38:26Z by NoahSalzman
  • JackCoates91
    JackCoates91
    77 Posts

    Re: Monitor Serial Number

    ‏2010-02-15T21:47:18Z  
    Visibility of monitor serial numbers is highly dependent on the driver in Windows, and it's entirely possible that some gear simply doesn't have a number (this is true of a lot of USB storage media too, FWIW). It may be possible to get more information by trying harder in different places, but this might also be as good as it gets.

    EDIT: I realize this thread is also looking at monitors attached to OSX machines, just wanted to point out that there's a software component involved which may or may not be getting handled properly in the case of a non-Apple monitor.
    Updated on 2010-02-15T21:47:18Z at 2010-02-15T21:47:18Z by JackCoates91
  • NoahSalzman
    NoahSalzman
    42 Posts

    Re: Monitor Serial Number

    ‏2010-02-16T17:22:22Z  
    The xml you posted shows that Apple's System Profiler utility is not gathering any details about the monitor; it only shows the NVIDIA card/GPU and no other info. It would appear that DisplayConfigX is working at the driver level.

    So, this approach -- parsing Apple's System Profiler xml output -- is clearly deficient in certain cases. It's a shame DisplayConfigX lacks a command line, otherwise we could leverage that utility.

    We can put in a feature request for new Mac inspectors that mirror DisplayConfigX's output.... but, honestly, it would be very far down the list of priorities.

    (The other possibility would involve other Mac command line utilities -- like kextfind or kextstat?? -- that could produce the info we need with a minimum of "driver-ID to friendly-name" translation. However, I think that is probably DisplayConfigX's secret sauce: performing that translation.)
    Updated on 2010-02-16T17:22:22Z at 2010-02-16T17:22:22Z by NoahSalzman
  • NoahSalzman
    NoahSalzman
    42 Posts

    Re: Monitor Serial Number

    ‏2010-02-17T03:18:51Z  
    So, as it turns out our "iokit registry" inspector can get the raw data we need, but there are a couple problems. One, the raw form of the data we get out of the iokit is usually a hexdump or a vendor ID code for which we don't have a mapping. Two, we don't have a map of all the possible node maps for each vendor (e.g. "ATY_Wormy" is specific to ATI, nVidia would be a different path).

    Here is an example:

    Q: data "IODisplayEDID" of dictionary of node "AppleBacklightDisplay" of node "display0" of node "ATY_Wormy" of node whose (path of it contains "ATY,Wormy@0") of node "display" of node "IOPCI2PCIBridge" of node "PEGP" of node "AppleACPIPCI" of node "PCI0" of node "AppleACPIPlatformExpert" of service plane of iokit registry

    A: %00%ff%ff%ff%ff%ff%ff%00%06%10`%9c%00%00%00%00%04%10%01%03%80"%16x%0a%1c%f5%97XP%8e''PT%00%00%00%01%01%01%01%01%01%01%01%01%01%01%01%01%01%01%01%9f%25%a0@Q%84%0c0@ 3%00K%cf%10%00%00%19%00%00%00%01%00%06%100%00%00%00%00%00%00%00%00%0a %00%00%00%fe%00B154PW01 V0%0a %00%00%00%fc%00Color LCD%0a %00%bc
    Sooo... at the moment you would need to gather sample data (to figure out what each vendor/model looks like in the iokit tree) or you could hire professional services to do it.
    Updated on 2010-02-17T03:18:51Z at 2010-02-17T03:18:51Z by NoahSalzman
  • NoahSalzman
    NoahSalzman
    42 Posts

    Re: Monitor Serial Number

    ‏2010-02-17T22:22:40Z  
    Ha! This has already been figured out... never thought to search the Forum first. Sigh.

    http://forum.bigfix.com/viewtopic.php?pid=8978#p8978
  • USMC175
    USMC175
    1 Post

    Re: Monitor Serial Number

    ‏2010-06-29T13:17:26Z  
    I'm using the below relevance to successfully obtain monitor serial numbers from WinXP desktop instances.

    q: ((if (exists first "000000fc00" of it) then hexadecimal string (first 24 of following texts of first "000000fc00" of it ) else "n/a"), (if (exists first "000000ff00" of it) then hexadecimal string (first 24 of following texts of first "000000ff00" of it ) else "n/a"), (hexadecimal integer (first 2 of following text of position 32 of it )/4) as string & "/" & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) of (values "EDID" of keys (("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\" & it & "\Device Parameters") of (string values of selects "PNPDeviceID from Win32_DesktopMonitor" of wmi) ) of registry as string)
    a: HP L1940T%0a%0a%0a, CNK73013DT%0a , 7/2007

    Couple of questions:

    1. How do I filter out the unexpected '%0a' that is affixed to the end of the model and serial number outputs?

    2. For WinXP Laptops, can the relevance be revised to obtain external monitor model and serial numbers?

    3. Does the new release of BigFix (8) allow for additional capabilities to obtain external monitor model and serial numbers from WinXP or Win7 Laptops?
  • BenKus
    BenKus
    399 Posts

    Re: Monitor Serial Number

    ‏2010-06-29T23:51:44Z  
    Hey uscm175,

    1. Probably the easiest way to remove unwanted characters is this expression: concatenation of substrings separated by "%0a" of ...

    So your expression would look like:
    q: (concatenation of substrings separated by "%0a" of (if (exists first "000000fc00" of it) then hexadecimal string (first 24 of following texts of first "000000fc00" of it ) else "n/a"), concatenation of substrings separated by "%0a" of (if (exists first "000000ff00" of it) then hexadecimal string (first 24 of following texts of first "000000ff00" of it ) else "n/a"), (hexadecimal integer (first 2 of following text of position 32 of it )/4) as string & "/" & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) of (values "EDID" of keys (("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\" & it & "\Device Parameters") of (string values of selects "PNPDeviceID from Win32_DesktopMonitor" of wmi) ) of registry as string)


    2. I think it depends on if XP itself knows the details of the monitor... I don't know the details exactly, but we have seen that XP monitors on Laptops behave differently than Windows 7. I just tried for a while and I couldn't figure out how to get an XP laptop to see the monitor (although my Win7 laptop is working fine).

    3. BigFix 8.0 has new inspectors that can count how many external monitors are available, but it doesn't know their model number or serial number so I am not sure if that helps much...

    Ben
  • rdamours91
    rdamours91
    10 Posts

    Re: Monitor Serial Number

    ‏2010-06-30T06:33:36Z  
    Sick.

    This one is going to come in handy :)
  • mcalvi91
    mcalvi91
    11 Posts

    Re: Monitor Serial Number

    ‏2010-08-05T15:06:24Z  
    We had an issue with some display port dongles from HP and needed not only SN of the monitor but manufacture date as well. We found a script that we converted to an EXE to inventory the systems for their monitor info. It takes a bit of tweaking but the data is gold...

    Cant remember where we found it so I below it. It pulls the EDID data and parses that.

    
    
    '**************************************Heading********************************* 
    ' info.vbs 
    ' 
    ' Jason Hofferle, jason@hofferle.com 
    ' 08/16/2006 - version 0.1.1 
    ' 
    ' Monitor EDID code written by Michael Baird and modified by Denny MANSART 
    ' 
    ' Abstract: 
    '           info.vbs - Command line utility that gathers hardware information 
    '                      including serial numbers from a remote computer. 
    ' 
    ' 
    ' Usage: 
    '           info [computer] 
    ' 
    ' Example: 
    '           info CXAFLSTPAW101 
    '           info ? 
    ' 
    '******************************************************************************   
    'Option Explicit   Dim objArgs Dim strComputer   Const strGeneral_01 = 
    "Abstract:" Const strGeneral_02 = 
    "             info.vbs - Command line utility that gathers" Const strGeneral_03 = 
    "                        hardware information including   " Const strGeneral_04 = 
    "                        serial numbers from a remote     " Const strGeneral_05 = 
    "                        computer.                        " Const strGeneral_06 = 
    "" Const strGeneral_07 = 
    "Jason Hofferle - jason.hofferle@dcma.mil" Const strGeneral_08 = 
    "6/17/2005 version 0.1.0" Const strGeneral_09 = 
    "Monitor EDID code written by Michael Baird and modified  " Const strGeneral_10 = 
    "by Denny MANSART                                         "   Const strUsage_01   = 
    "Usage:" Const strUsage_02   = 
    "               info [computer]" Const strUsage_03   = 
    "Examples:" Const strUsage_04   = 
    "               info CXAFLSTPAW101" Const strUsage_05   = 
    "               info ?"   Const strError_ComputerNameNotFound = 
    "Computer name not found, using local system." Const strError_ConnectingToComputer = 
    "Error connecting to specified computer." Const strError_ComputerNotFound = 
    "Specified computer could not be found on the network." Const strError_AlreadyAdmin = 
    "Specified user is already a member of the Administrators group." Const strError_UserNotFound = 
    "Specified user could not be found in the domain." Const strError_AddingUser = 
    "Error adding user to specified computer." Const strError_CannotPing = 
    "Cannot ping remote computer."   On Error Resume Next Err.Clear Set objArgs = WScript.Arguments If objArgs.Count > 0 Then strComputer = objArgs(0) 
    
    if Not Pingable(strComputer) then Wscript.echo strError_CannotPing strComputer = 
    "?" End If Else Wscript.Echo strError_ComputerNameNotFound strComputer = 
    "." End If   If strComputer = 
    "?" Then WScript.Echo strGeneral_01 WScript.Echo strGeneral_02 WScript.Echo strGeneral_03 WScript.Echo strGeneral_04 WScript.Echo strGeneral_05 WScript.Echo strGeneral_06 WScript.Echo strGeneral_07 WScript.Echo strGeneral_08 WScript.Echo strGeneral_09 WScript.Echo strGeneral_10 WScript.Echo 
    "" WScript.Echo strUsage_01 WScript.Echo strUsage_02 WScript.Echo strUsage_03 WScript.Echo strUsage_04 WScript.Echo strUsage_05 WScript.Quit End If     winmgmt1 = 
    "winmgmts:{impersonationLevel=impersonate}!//"& strComputer &
    "" Set SerialN = GetObject( winmgmt1 ).InstancesOf (
    "Win32_BIOS")   For each Serial in SerialN WScript.Echo 
    "Serial Number: " & Serial.SerialNumber Next   Set objWMIService = GetObject(
    "winmgmts:" _ & 
    "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2
    ")   Set colItems = objWMIService.ExecQuery _ (
    "Select * from Win32_PhysicalMemoryArray")   For Each objItem in colItems 
    'Wscript.Echo "Description: " & objItem.Description Wscript.Echo 
    "Maximum Capacity: " & objItem.MaxCapacity 
    'Wscript.Echo "Memory Devices: " & objItem.MemoryDevices 
    'Wscript.Echo "Memory Error Correction: " & objItem.MemoryErrorCorrection Next     Set objWMIService = GetObject(
    "winmgmts:" _ & 
    "{impersonationLevel=impersonate}!\\" _ & strComputer & 
    "\root\cimv2") Set colSMBIOS = objWMIService.ExecQuery _ (
    "Select * from Win32_SystemEnclosure") For Each objSMBIOS in colSMBIOS Wscript.Echo 
    "Part Number: " & objSMBIOS.PartNumber WScript.Echo 
    "Serial Number: " _ & objSMBIOS.SerialNumber WScript.Echo 
    "Asset Tag: " _ & objSMBIOS.SMBIOSAssetTag Next   WScript.Echo 
    ""     
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ' 
    ' Monitor EDID Information' 
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ''
    ' 
    '17 June 2004 
    'coded by Michael Baird 
    ' 
    'Modified by Denny MANSART (27/07/2004) 
    ' 
    'and released under the terms of GNU open source license agreement 
    '(that is of course if you CAN release code that uses WMI under GNU) 
    ' 
    'Please give me credit if you use my code   
    'this code is based on the EEDID spec found at http://www.vesa.org 
    'and by my hacking around in the windows registry 
    'the code was tested on WINXP,WIN2K and WIN2K3 
    'it should work on WINME and WIN98SE 
    'It should work with multiple monitors, but that hasn't been tested either.   Dim oDisplaySubKeys : Set oDisplaySubKeys = CreateObject(
    "Scripting.Dictionary") Dim oRawEDID : Set oRawEDID = CreateObject(
    "Scripting.Dictionary") Const HKLM = &H80000002 
    'HKEY_LOCAL_MACHINE   Int intMonitorCount=0 Int intDisplaySubKeysCount=0 Int i=0   
    ' Set WshNet=CreateObject("Wscript.Network") 
    ' MyComputerName=WshNet.ComputerName 
    ' 
    ' strComputer=MyComputerName 
    'strComputer=wscript.arguments(0)   Set oRegistry = GetObject(
    "winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "/root/
    
    default:StdRegProv
    ") strDisplayBaseKey = 
    "SYSTEM\CurrentControlSet\Enum\DISPLAY\"   
    ' Retrieving EISA-Id from HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY and storing in strarrDisplaySubKeys iRC = oRegistry.EnumKey(HKLM, strDisplayBaseKey, strarrDisplaySubKeys)   
    ' Deleting from strarrDisplaySubKeys "Default_Monitor" value For Each sKey In strarrDisplaySubKeys   If sKey =
    "Default_Monitor" Then intDisplaySubKeysCount=intDisplaySubKeysCount - 1 Else oDisplaySubKeys.add sKey, intDisplaySubKeysCount End If   intDisplaySubKeysCount=intDisplaySubKeysCount + 1   Next   
    ' Storing result in oDisplaySubKeys strResultDisplaySubKeys=oDisplaySubKeys.Keys   toto=0   For i = 0 to oDisplaySubKeys.Count -1   strEisaIdBaseKey = strDisplayBaseKey & strResultDisplaySubKeys(i) & 
    "\"   
    ' Retrieving Pnp-Id from HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\EISA-Id and storing in strarrEisaIdSubKeys iRC2 = oRegistry.EnumKey(HKLM, strEisaIdBaseKey, strarrEisaIdSubKeys)   For Each sKey2 In strarrEisaIdSubKeys oRegistry.GetMultiStringValue HKLM, strEisaIdBaseKey & sKey2 & 
    "\", "HardwareID
    ", sValue   For tmpctr=0 to ubound(svalue)   If lcase(Left(svalue(tmpctr),8))=
    "monitor\" then   strMsIdBaseKey = strEisaIdBaseKey & sKey2 & 
    "\"   iRC3 = oRegistry.EnumKey(HKLM, strMsIdBaseKey, strarrMsIdSubKeys)   For Each sKey3 In strarrMsIdSubKeys   If skey3=
    "Control" then   toto=toto + 1   oRegistry.GetBinaryValue HKLM, strMsIdBaseKey & 
    "Device Parameters\", "EDID
    ", intarrEDID 
    ' Test file 
    'Dim objFileSystem, objOutputFile 
    'Dim strOutputFile 
    'Set objFileSystem = CreateObject("Scripting.fileSystemObject") 
    'strOutputFile = "C:/temp/" & Split(WScript.ScriptName, ".")(0) & "-" & toto & ".txt" 
    'Set objOutputFile = objFileSystem.CreateTextFile(strOutputFile, TRUE) 
    'objOutputFile.WriteLine(strMsIdBaseKey & "Device Parameters\" & "EDID")   
    ' Reinitializing string to null to clear all datas strRawEDID=
    "" strRawEDIDb=
    ""   If vartype(intarrEDID) = 8204 then   For each strByteValue in intarrEDID   strRawEDID=strRawEDID & Chr(strByteValue) strRawEDIDb=strRawEDIDb & Chr(strByteValue) 
    ' Test file 
    'objOutputFile.WriteLine(strRawEDIDb)   Next   Else   strRawEDID=
    "EDID Not Available"   End If 
    ' Test file 
    'objOutputFile.WriteLine(strRawEDIDb) 
    'objOutputFile.Close 
    'Set objFileSystem = Nothing   oRawEDID.add intMonitorCount , strRawEDID intMonitorCount=intMonitorCount + 1   End If Next End If Next Next Next     
    '***************************************************************************************** 
    'now the EDID info For each active monitor is stored in an dictionnary of strings called oRawEDID 
    'so we can process it to get the good stuff out of it which we will store in a 5 dimensional array 
    'called arrMonitorInfo, the dimensions are as follows: 
    '0=VESA Mfg ID, 1=VESA Device ID, 2=MFG Date (M/YYYY),3=Serial Num (If available),4=Model Descriptor 
    '5=EDID Version 
    '*****************************************************************************************   strResultRawEDID=oRawEDID.Keys   dim arrMonitorInfo() redim arrMonitorInfo(intMonitorCount-1,5) dim location(3)   
    ' Test file 
    'Set objFileSystem = CreateObject("Scripting.fileSystemObject") 
    'strOutputFile = "C:/temp/" & Split(WScript.ScriptName, ".")(0) & "-test.txt" 
    'Set objOutputFile = objFileSystem.CreateTextFile(strOutputFile, TRUE)   For i=0 to oRawEDID.Count - 1   If oRawEDID(i)  
    "EDID Not Available" then   
    '********************************************************************* 
    'first get the model and serial numbers from the vesa descriptor 
    'blocks in the edid. the model number is required to be present 
    'according to the spec. (v1.2 and beyond)but serial number is not 
    'required. There are 4 descriptor blocks in edid at offset locations 
    '&H36 &H48 &H5a and &H6c each block is 18 bytes long 
    '*********************************************************************   location(0)=mid(oRawEDID(i),&H36+1,18) location(1)=mid(oRawEDID(i),&H48+1,18) location(2)=mid(oRawEDID(i),&H5a+1,18) location(3)=mid(oRawEDID(i),&H6c+1,18)   
    ' Test file 
    'objOutputFile.WriteLine("Location-0") 
    'objOutputFile.WriteLine(location(0)) 
    'objOutputFile.WriteLine("Location-1") 
    'objOutputFile.WriteLine(location(1)) 
    'objOutputFile.WriteLine("Location-2") 
    'objOutputFile.WriteLine(location(2)) 
    'objOutputFile.WriteLine("Location-3") 
    'objOutputFile.WriteLine(location(3))   
    'you can tell If the location contains a serial number If it starts with &H00 00 00 ff strSerFind=Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&Hff)   
    'or a model description If it starts with &H00 00 00 fc strMdlFind=Chr(&H00) & Chr(&H00) & Chr(&H00) & Chr(&Hfc)   intSerFoundAt=-1 intMdlFoundAt=-1   For findit = 0 to 3 If instr(location(findit),strSerFind)>0 then   intSerFoundAt=findit   End If   If instr(location(findit),strMdlFind)>0 then   intMdlFoundAt=findit   End If   Next   
    'If a location containing a serial number block was found then store it If intSerFoundAt-1 then   tmp=Right(location(intSerFoundAt),14)   If instr(tmp,Chr(&H0a))>0 then   tmpser=Trim(Left(tmp,instr(tmp,Chr(&H0a))-1))   Else   tmpser=Trim(tmp)   End If   
    'although it is not part of the edid spec it seems as though the 
    'serial number will frequently be preceeded by &H00, this 
    'compensates For that If Left(tmpser,1)=Chr(0) then tmpser=Right(tmpser,Len(tmpser)-1)   Else   tmpser=
    "Serial Number Not Found in EDID data"   End If   
    'If a location containing a model number block was found then store it If intMdlFoundAt-1 then   tmp=Right(location(intMdlFoundAt),14)   If instr(tmp,Chr(&H0a))>0 then   tmpmdl=Trim(Left(tmp,instr(tmp,Chr(&H0a))-1))   Else   tmpmdl=Trim(tmp)   End If   
    'although it is not part of the edid spec it seems as though the 
    'serial number will frequently be preceeded by &H00, this 
    'compensates For that If Left(tmpmdl,1)=Chr(0) then tmpmdl=Right(tmpmdl,Len(tmpmdl)-1)   Else   tmpmdl=
    "Model Descriptor Not Found in EDID data"   End If   
    '************************************************************** 
    'Next get the mfg date 
    '************************************************************** 
    'the week of manufacture is stored at EDID offset &H10 tmpmfgweek=Asc(mid(oRawEDID(i),&H10+1,1))   
    'the year of manufacture is stored at EDID offset &H11 
    'and is the current year -1990 tmpmfgyear=(Asc(mid(oRawEDID(i),&H11+1,1)))+1990   
    'store it in month/year format tmpmdt=month(dateadd(
    "ww",tmpmfgweek,DateValue(
    "1/1/" & tmpmfgyear))) & 
    "/" & tmpmfgyear   
    '************************************************************** 
    'Next get the edid version 
    '************************************************************** 
    'the version is at EDID offset &H12 tmpEDIDMajorVer=Asc(mid(oRawEDID(i),&H12+1,1))   
    'the revision level is at EDID offset &H13 tmpEDIDRev=Asc(mid(oRawEDID(i),&H13+1,1))   
    'store it in month/year format If tmpEDIDMajorVer < 255-48 and tmpEDIDRev < 255-48 Then   tmpver=Chr(48+tmpEDIDMajorVer) & 
    "." & Chr(48+tmpEDIDRev)   Else tmpver=
    "Not available"   End If   
    '************************************************************** 
    'Next get the mfg id 
    '************************************************************** 
    'the mfg id is 2 bytes starting at EDID offset &H08 
    'the id is three characters long. using 5 bits to represent 
    'each character. the bits are used so that 1=A 2=B etc.. 
    ' 
    'get the data tmpEDIDMfg=mid(oRawEDID(i),&H08+1,2)   Char1=0 : Char2=0 : Char3=0   Byte1=Asc(Left(tmpEDIDMfg,1)) 
    'get the first half of the string Byte2=Asc(Right(tmpEDIDMfg,1)) 
    'get the first half of the string   
    'now shift the bits 
    'shift the 64 bit to the 16 bit If (Byte1 and 64) > 0 then Char1=Char1+16   
    'shift the 32 bit to the 8 bit If (Byte1 and 32) > 0 then Char1=Char1+8   
    'etc.... If (Byte1 and 16) > 0 then Char1=Char1+4 If (Byte1 and 8) > 0 then Char1=Char1+2 If (Byte1 and 4) > 0 then Char1=Char1+1   
    'the 2nd character uses the 2 bit and the 1 bit of the 1st byte If (Byte1 and 2) > 0 then Char2=Char2+16 If (Byte1 and 1) > 0 then Char2=Char2+8   
    'and the 128,64 and 32 bits of the 2nd byte If (Byte2 and 128) > 0 then Char2=Char2+4 If (Byte2 and 64) > 0 then Char2=Char2+2 If (Byte2 and 32) > 0 then Char2=Char2+1   
    'the bits For the 3rd character don't need shifting 
    'we can use them as they are Char3=Char3+(Byte2 and 16) Char3=Char3+(Byte2 and 8) Char3=Char3+(Byte2 and 4) Char3=Char3+(Byte2 and 2) Char3=Char3+(Byte2 and 1)   tmpmfg=Chr(Char1+64) & Chr(Char2+64) & Chr(Char3+64)   
    '************************************************************** 
    'Next get the device id 
    '************************************************************** 
    'the device id is 2bytes starting at EDID offset &H0a 
    'the bytes are in reverse order. 
    'this code is not text. it is just a 2 byte code assigned 
    'by the manufacturer. they should be unique to a model tmpEDIDDev1=hex(Asc(mid(oRawEDID(i),&H0a+1,1))) tmpEDIDDev2=hex(Asc(mid(oRawEDID(i),&H0b+1,1)))   If Len(tmpEDIDDev1)=1 then tmpEDIDDev1=
    "0" & tmpEDIDDev1 If Len(tmpEDIDDev2)=1 then tmpEDIDDev2=
    "0" & tmpEDIDDev2   tmpdev=tmpEDIDDev2 & tmpEDIDDev1   
    '************************************************************** 
    'finally store all the values into the array 
    '************************************************************** arrMonitorInfo(i,0)=tmpmfg arrMonitorInfo(i,1)=tmpdev arrMonitorInfo(i,2)=tmpmdt arrMonitorInfo(i,3)=tmpser arrMonitorInfo(i,4)=tmpmdl arrMonitorInfo(i,5)=tmpver End If   wscript.echo 
    "Monitor " & Chr(i+65) & 
    ")" wscript.echo 
    ".........." & 
    "VESA Manufacturer ID= " & arrMonitorInfo(i,0) wscript.echo 
    ".........." & 
    "Device ID= " & arrMonitorInfo(i,1) wscript.echo 
    ".........." & 
    "Manufacture Date= " & arrMonitorInfo(i,2) wscript.echo 
    ".........." & 
    "Serial Number= " & arrMonitorInfo(i,3) wscript.echo 
    ".........." & 
    "Model Name= " & arrMonitorInfo(i,4) wscript.echo 
    ".........." & 
    "EDID Version= " & arrMonitorInfo(i,5)     Next   
    ' Test file 
    'objOutputFile.Close 
    'Set objFileSystem = NothingART     Function ErrorCheck(strErrorNumber) Select Case strErrorNumber Case 
    "-2147024843" ErrorCheck =  strError_ComputerNotFound Case 
    "-2147023518" ErrorCheck = strError_AlreadyAdmin Case 
    "-2147023509" ErrorCheck = strError_UserNotFound End Select End Function   Function Pingable(strComputer) Dim objShell Dim strTemp Dim objFSO Dim iReturn Dim objTextFile Pingable = False Set objShell = CreateObject(
    "WScript.Shell") strTemp = objShell.ExpandEnvironmentStrings(
    "%temp%") & _ 
    "/tempping.txt" iReturn = objShell.Run(
    "%comspec% /C ping " & strComputer & _ 
    " -n 1 > " & strTemp, 0, True) Set objFSO = CreateObject(
    "Scripting.FileSystemObject") Set objTextFile = objFSO.OpenTextFile(strTemp, 1) While Not objTextFile.AtEndOfStream If InStr(objTextFile.ReadLine, 
    "Reply") Then Pingable = True Wend objTextFile.Close objFSO.DeleteFile (strTemp)   End Function
    

    the output is below...

    
    C:\>cscript /nologo monitor_info.vbs Computer name not found, using local system. Serial Number: MXL9040HWP Maximum Capacity: 4194304 Maximum Capacity: 4096 Part Number: Serial Number: MXL9040HWP Asset Tag: MXL9040HWP   Monitor A) ..........VESA Manufacturer ID= HWP ..........Device ID= 264B ..........Manufacture Date= 9/2006 ..........Serial Number= CNK6380R6C ..........Model Name= HP L1755 ..........EDID Version= 1.3 Monitor B) ..........VESA Manufacturer ID= HWP ..........Device ID= 264B ..........Manufacture Date= 9/2006 ..........Serial Number= CNK6380R6C ..........Model Name= HP L1755 ..........EDID Version= 1.3 Monitor C) ..........VESA Manufacturer ID= HWP ..........Device ID= 26FB ..........Manufacture Date= 4/2009 ..........Serial Number= CNK9170083 ..........Model Name= HP L2245w ..........EDID Version= 1.3 Monitor D) ..........VESA Manufacturer ID= HWP ..........Device ID= 26FB ..........Manufacture Date= 4/2009 ..........Serial Number= CNK9170083 ..........Model Name= HP L2245w ..........EDID Version= 1.3 Monitor E) ..........VESA Manufacturer ID= NEC ..........Device ID= 61BE ..........Manufacture Date= 7/2001 ..........Serial Number= Serial Number Not Found in EDID data ..........Model Name= Model Descriptor Not Found in EDID data ..........EDID Version= 1.3
    

    MC
  • SystemAdmin
    SystemAdmin
    562 Posts

    Re: Monitor Serial Number

    ‏2011-12-08T18:18:20Z  
    Jack / Noah, We are using some utilities like DisplayConfigX (http://3dexpress.de) or SwitchResX or or MonInfo (http://www.entechtaiwan.com/util/moninfo.shtm) to grab the data which is what we are comparing to BigFix.

    Here is the output from BigFix (display_info.xml). Running displayconfigx or switchresx on the mac system shows:
    Monitor: Acer AL1916W
    Model: ad86
    Resolution: 1024x768

    I have two test os x machines, one with 10.4.1 and the other 10.5.8. Right now the 10.5.8 machine is having issues. I'll try on our production units tomorrow.

    John
    Updated on 2011-12-08T18:18:20Z at 2011-12-08T18:18:20Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    562 Posts

    Re: Monitor Serial Number

    ‏2011-12-28T18:15:21Z  
    • BenKus
    • ‏2010-06-29T23:51:44Z
    Hey uscm175,

    1. Probably the easiest way to remove unwanted characters is this expression: concatenation of substrings separated by "%0a" of ...

    So your expression would look like:
    q: (concatenation of substrings separated by "%0a" of (if (exists first "000000fc00" of it) then hexadecimal string (first 24 of following texts of first "000000fc00" of it ) else "n/a"), concatenation of substrings separated by "%0a" of (if (exists first "000000ff00" of it) then hexadecimal string (first 24 of following texts of first "000000ff00" of it ) else "n/a"), (hexadecimal integer (first 2 of following text of position 32 of it )/4) as string & "/" & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) of (values "EDID" of keys (("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\" & it & "\Device Parameters") of (string values of selects "PNPDeviceID from Win32_DesktopMonitor" of wmi) ) of registry as string)


    2. I think it depends on if XP itself knows the details of the monitor... I don't know the details exactly, but we have seen that XP monitors on Laptops behave differently than Windows 7. I just tried for a while and I couldn't figure out how to get an XP laptop to see the monitor (although my Win7 laptop is working fine).

    3. BigFix 8.0 has new inspectors that can count how many external monitors are available, but it doesn't know their model number or serial number so I am not sure if that helps much...

    Ben
    Ben is there anyway to account for multiple displays?

    I have a workstation with 2 monitors however I only get 1 monitor returned on the results page. Also I get a lot of "Error" results "Singular expression refers to a nonexistant object." any idea how to fix that? out of 6k computers about 2k of them are coming back with that error.

    Thanks,
    Alex
  • BenKus
    BenKus
    399 Posts

    Re: Monitor Serial Number

    ‏2011-12-29T19:23:04Z  
    Ben is there anyway to account for multiple displays?

    I have a workstation with 2 monitors however I only get 1 monitor returned on the results page. Also I get a lot of "Error" results "Singular expression refers to a nonexistant object." any idea how to fix that? out of 6k computers about 2k of them are coming back with that error.

    Thanks,
    Alex
    Hi Alex,

    There are probably lost of reasons you could get an error if the format of the string doesn't match what my computer says...

    I tried to add some error checking to skip unknown values... This syntax will work in 8.0+ agents:

    q: ((concatenation of substrings separated by "%0a" of (if (exists first "000000fc00" of it) then hexadecimal string (first 24 of following texts of first "000000fc00" of it ) else "n/a") | "n/a"), (concatenation of substrings separated by "%0a" of (if (exists first "000000ff00" of it) then hexadecimal string (first 24 of following texts of first "000000ff00" of it ) else "n/a")) | "n/a", ((hexadecimal integer (first 2 of following text of position 32 of it )/4) as string & "/" & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) | "n/a") of (it whose (length of it > 32 AND it contains "000000ff00")) of (values "EDID" of keys (("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\" & it & "\Device Parameters") of (string values of selects "PNPDeviceID from Win32_DesktopMonitor" of wmi) ) of registry as string)
    A: DELL 2007FP, C953667C1FLL, 7/2006

    Ben
  • jpeppers91
    jpeppers91
    6 Posts

    Re: Monitor Serial Number

    ‏2013-10-21T12:29:50Z  
    • BenKus
    • ‏2011-12-29T19:23:04Z
    Hi Alex,

    There are probably lost of reasons you could get an error if the format of the string doesn't match what my computer says...

    I tried to add some error checking to skip unknown values... This syntax will work in 8.0+ agents:

    q: ((concatenation of substrings separated by "%0a" of (if (exists first "000000fc00" of it) then hexadecimal string (first 24 of following texts of first "000000fc00" of it ) else "n/a") | "n/a"), (concatenation of substrings separated by "%0a" of (if (exists first "000000ff00" of it) then hexadecimal string (first 24 of following texts of first "000000ff00" of it ) else "n/a")) | "n/a", ((hexadecimal integer (first 2 of following text of position 32 of it )/4) as string & "/" & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) | "n/a") of (it whose (length of it > 32 AND it contains "000000ff00")) of (values "EDID" of keys (("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\" & it & "\Device Parameters") of (string values of selects "PNPDeviceID from Win32_DesktopMonitor" of wmi) ) of registry as string)
    A: DELL 2007FP, C953667C1FLL, 7/2006

    Ben

    Is there a way to report on multiple monitors of a workstation?

     

     

  • castillo0218
    castillo0218
    1 Post

    Re: Monitor Serial Number

    ‏2014-06-26T19:58:49Z  

    Is there a way to report on multiple monitors of a workstation?

     

     

    I second this