Customizing the custom inventory sample script for Windows

Article:HOWTO50036  |  Created: 2011-04-18  |  Updated: 2011-04-18  |  Article URL http://www.symantec.com/docs/HOWTO50036
Article Type
How To


Subject


Customizing the custom inventory sample script for Windows

(Windows only)

The easiest way to create a new custom inventory script task is to clone the existing sample and customize 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 data that you want and to populate the attribute variables in the script.

Note that every time you create or edit an existing custom data class, the data class is assigned a new GUID. 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 customize 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 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, select the data class and 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.


Legacy ID



v13429553_v57840676


Article URL http://www.symantec.com/docs/HOWTO50036


Terms of use for this information are found in Legal Notices