Custom Inventory for Video/Display Drivers

book

Article ID: 178740

calendar_today

Updated On:

Products

Inventory Solution

Issue/Introduction

 

Resolution

Hardware Inventory collects some information on video drivers in the Inv_HW_Video_Controller_Windows table but more information can be obtained from the Win32_VideoController WMI class by a custom inventory. The following steps show how to set up a custom inventory to collect video driver information. Please note that Symantec Support does not support customization so further modifications must be made by the user.

  1. Create a new custom data class that will store the driver information for each computer.
    1. Go to Settings>All Settings then Settings>Discovery and Inventory>Inventory Solution>Manage Custom Data Classes.
    2. Click New data class.
    3. Name the data class Video_Drivers.
    4. Click Add attribute.
    5. Name the attribute "Model", set Key to "No", and click OK.
    6. Add three more attributes the same way named "Version", then "Installed Display Drivers", and then "Date".
    7. Click Save Changes at the bottom of the Manage Custom Data Classes page.
  2. Create a Custom Inventory Script Task.
    1. Go to Manage>Jobs and Tasks.
    2. Browse the folder drop-down menu to a folder where you would like to add a custom inventory script task.
    3. Right-click on the folder, then select New>Task.
    4. Select the Run Script task.
    5. Name the task appropriately.
    6. Select Script type: VBScript.
    7. Copy and paste the entire vbscript below into the large text box of the script task. Then edit the script to use the custom data class created in step 1-3

      '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

       

  3. Run the Custom Inventory Script task
    1. Click on New Schedule, choose Now or specify a schedule time and repeat interval.
    2. Specify target computers to run the task on.
    3. To target a single computer click in the Quick add: box and search for the name of the computer, or use the Quick Run feature instead of New Schedule.
    4. To target a list of computers click on Add>Computers or Devices then manually select the desired computers and click > and OK.
    5. To target a computer filter (such as All Computers) click on Add>Target, click Add rule, choose exclude computers not in, and search the name of the filter in the final drop-down box. then click OK.
  4. Create a Custom Report to view the data collected by the custom inventory
    1. Go to Reports>All Reports.
    2. Browse to a folder where you would like to add the custom report and right-click on the folder.
      Select New>Report>SQL Report.
    3. Give the report an appropriate name.
    4. Replace the text under Parameterized Query with the following query.

      select vComputer.Name, Inv_Video_Drivers.Model, Inv_Video_Drivers.Version, Inv_Video_Drivers.[Installed Display Drivers], Inv_Video_Drivers.Date
      from Inv_Video_Drivers
      left join vComputer on vComputer.Guid = Inv_Video_Drivers._ResourceGuid

    5. Click Save Changes and then view the collected custom inventory data for each computer.