Searching...
Filters
SmallMediumLarge
Home Print Show Topic URL Previous Next
IT Management Suite
Client Management Suite
Server Management Suite
Deployment Solution
Asset Management Suite
ServiceDesk

Configuring the custom inventory sample script for Windows

Inventory Solution

Symantec recommends that you clone the existing custom inventory script task sample, and then configure it according to your needs. The sample script for Windows already contains the required code for a WMI query. You only need to add your own logic to gather the necessary data and to populate the attribute variables in the script.

Every time you create or edit an existing custom data class, a new GUID is assigned to this data class. You must manually update the script with the new GUID, if it refers to the older GUID for the same custom data class.

See Creating a custom inventory script task

See Gathering custom inventory

To configure the custom inventory sample script for Windows

  1. Clone or open an existing sample of the custom inventory script task.

  2. Specify the values that you want to gather.

    Example:

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:" &

    "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

    'Fire WMI Query

    Set objCIMObj = objWMIService.ExecQuery("select * from CIM_processor")

  3. Replace the GUID in the script with the GUID of the data class that you created.

    Example:

    set objDCInstance = nse.AddDataClass ("{e8220123-4987-4b5e-bc39- ec6eaea312ef}")

    To access the GUID of the data class that you created, do the following:

    • In the Symantec Management Console, on the Settings menu, click All Settings.

    • In the left pane, under Settings, expand Discovery and Inventory > Inventory Solution, and then click Manage Custom Data classes.

    • On the Manage Custom Data Classes page, click the data class, and then, under Manage Custom Data Classes, on the toolbar, click the Details symbol.

  4. Update attributes of the data class.

    Example:

    For each objInfo in objCIMObj

    'Add a new row

    dim objDataRow

    set objDataRow = objDataClass.AddRow

    'Set columns

    objDataRow.SetField 0, objInfo.DeviceID

    objDataRow.SetField 1, objInfo.L2CacheSize

    objDataRow.SetField 2, objInfo.L2CacheSpeed

    Next

  5. Click Save changes.