Client Management Suite

 View Only
  • 1.  Custom Inventory Script Work - Chipset, Wireless, BT, AMT

    Posted Apr 17, 2019 10:35 AM

    Hi all,

    I came across the article https://support.symantec.com/en_US/article.HOWTO124002.html for creating a reporting on a custom inventory of Display drivers. It worked great, and now I am about to start trying to rework the VBScript to work for the collection of other drivers. Namely, Processor, Wireless, Bluetooth, and AMT. But before I sunk too much time into it, I wanted to check here if anyone already had similar scripts available (I am just now learning VB, and this may take me some time to rework). Or if you dont have any scripts available, if you could point me in the right direction of creating my own. I see, in the below script, they are doing a WMI query from Win32_VideoController. How could I locate the other WMI queries to find the processor, BT, wireless, AMT driver information?

    Thank you in advance!

     

    'Following is a sample custom inventory sript gathering information about processor of a machine and posting data
    'to NS using Altiris NSE Component
    'Adapted from http://www.symantec.com/connect/forums/altiris-71-custom-inventory-video-driver-versions
    '=========================================================================================
    '      On Error Resume Next
    'Create instance of Wbem service object and connect to namespace
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    'Fire WMI Query
    Set objCIMObj = objWMIService.ExecQuery("Select * from Win32_VideoController")
    '=========================================================================================
    'Create instance of Altiris NSE component
    dim nse
    set nse = WScript.CreateObject ("Altiris.AeXNSEvent")
    ' Set the header data of the NSE
    ' Please don't modify this GUID
    nse.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}"
    nse.Priority = 1
    'Create Inventory data block. Here assumption is that the data class with below guid is already configured on server
    dim objDCInstance
    set objDCInstance = nse.AddDataClass ("Video_Drivers") '****Your Custom Data Class Name here
    dim objDataClass
    set objDataClass = nse.AddDataBlock (objDCInstance)
    For each objInfo in objCIMObj
    'Add a new row
    dim objDataRow
    set objDataRow = objDataClass.AddRow
    'Set columns
    objDataRow.SetField 0, objInfo.Name
    objDataRow.SetField 1, objInfo.DriverVersion
    objDataRow.SetField 2, objInfo.InstalledDisplayDrivers
    objDataRow.SetField 3, objInfo.DriverDate
    Next
    
    nse.SendQueued

     



  • 2.  RE: Custom Inventory Script Work - Chipset, Wireless, BT, AMT

    Posted Apr 17, 2019 11:12 AM

    Update:

     

    I attempted to convert this script to gather network driver information, using the class information found here: https://docs.microsoft.com/en-us/windows/desktop/cimwin32prov/win32-networkadapter

     

    After running the script on my test machine, it does not populate my custom Network_Drivers dataclass as I expected it to. Here is my adapter script for Network drivers (Honestly, Im not too sure this is the class i am looking for either)

     

    'Adapted from http://www.symantec.com/connect/forums/altiris-71-custom-inventory-video-driver-versions
    '=========================================================================================
    '      On Error Resume Next
    'Create instance of Wbem service object and connect to namespace
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    'Fire WMI Query
    Set objCIMObj = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter")
    '=========================================================================================
    'Create instance of Altiris NSE component
    dim nse
    set nse = WScript.CreateObject ("Altiris.AeXNSEvent")
    ' Set the header data of the NSE
    ' Please don't modify this GUID
    nse.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}"
    nse.Priority = 1
    'Create Inventory data block. Here assumption is that the data class with below guid is already configured on server
    dim objDCInstance
    set objDCInstance = nse.AddDataClass ("Network_Drivers") '****Your Custom Data Class Name here
    dim objDataClass
    set objDataClass = nse.AddDataBlock (objDCInstance)
    For each objInfo in objCIMObj
    'Add a new row
    dim objDataRow
    set objDataRow = objDataClass.AddRow
    'Set columns
    objDataRow.SetField 0, objInfo.AdapterType
    objDataRow.SetField 1, objInfo.Name
    objDataRow.SetField 2, objInfo.Installed
    objDataRow.SetField 3, objInfo.DeviceID
    Next
    
    nse.SendQueued

     



  • 3.  RE: Custom Inventory Script Work - Chipset, Wireless, BT, AMT

    Posted Apr 17, 2019 03:09 PM

    I use WMIExplorer to find WMI Classes:

    https://github.com/vinaypamnani/wmie2/releases

    You can test queries in it too.



  • 4.  RE: Custom Inventory Script Work - Chipset, Wireless, BT, AMT

    Posted Apr 18, 2019 09:03 AM

    Thank you Andy, that is of great help!



  • 5.  RE: Custom Inventory Script Work - Chipset, Wireless, BT, AMT
    Best Answer

    Posted Apr 18, 2019 09:06 AM

    So I managed to meet my needs and resolve this issue. I found most of the information that I needed in the "Win32_PnpSignedDriver" class. I modified the Display drivers script as follow, and all is well:

     

    Network Drivers

    'Adapted from http://www.symantec.com/connect/forums/altiris-71-custom-inventory-video-driver-versions
    '=========================================================================================
    '      On Error Resume Next
    'Create instance of Wbem service object and connect to namespace
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    'Fire WMI Query
    Set objCIMObj = objWMIService.ExecQuery("SELECT * FROM Win32_PnPSignedDriver where deviceclass = 'net'")  
    '=========================================================================================
    'Create instance of Altiris NSE component
    dim nse
    set nse = WScript.CreateObject ("Altiris.AeXNSEvent")
    ' Set the header data of the NSE
    ' Please don't modify this GUID
    nse.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}"
    nse.Priority = 1
    'Create Inventory data block. Here assumption is that the data class with below guid is already configured on server
    dim objDCInstance
    set objDCInstance = nse.AddDataClass ("Network_Drivers") '****Your Custom Data Class Name here
    dim objDataClass
    set objDataClass = nse.AddDataBlock (objDCInstance)
    For each objInfo in objCIMObj
    'Add a new row
    dim objDataRow
    set objDataRow = objDataClass.AddRow
    'Set columns
    objDataRow.SetField 0, objInfo.DeviceName
    objDataRow.SetField 1, objInfo.DriverVersion
    objDataRow.SetField 2, objInfo.Infname
    Next
    
    nse.SendQueued

     

    Thanks!