This is a how to video on creating custom inventory. Custom inventory helps you extend the type of inventory you gather by adding the new data classes that are not included by default. Custom inventory also lets you extend the use of a predefined data class by customizing it.
Note: This is a silent video.
For more information, please see the guide at the following location: www.symantec.com/docs/DOC4730
00:04:05
create your custum inventory class,a vbs task similar to the one below and run the task regulary.
'Gather registry key value from machine and posting data to NS using Altiris NSE Component '=================================================================================================================== ' On Error Resume Next const HKEY_LOCAL_MACHINE = &H80000002 Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") '=================================================================================================================== 'Computer Identification '=================================================================================================================== strKeyPath = "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" strValueName1 = "LabPC_QL" strValueName2 = "LabPC_OWNER" strValueName3 = "LabPC_LOCATION" strValueName4 = "LabPC_SITE" strValueName5 = "LabPC_DEPUTY" strValueName6 = "LabPC_SoftFilter" oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName1,LabPC_QL oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName2,LabPC_OWNER oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName3,LabPC_LOCATION oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName4,LabPC_SITE oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName5,LabPC_DEPUTY oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName6,LabPC_SoftFilter if isnull(LabPC_QL) then LabPC_QL = "0" end if if isnull(LabPC_OWNER) then LabPC_OWNER = "missing_data" end if if isnull(LabPC_LOCATION) then LabPC_LOCATION = "missing_data" end if if isnull(LabPC_SITE) then LabPC_SITE = "missing_data" end if if isnull(LabPC_DEPUTY) then LabPC_DEPUTY = "missing_data" end if if isnull(LabPC_SoftFilter) then LabPC_SoftFilter = "missing_data" end if LM = year(now) & "-" & month(now) & "-" & day(now) & " " & hour(now) & ":" & minute(now) & ":" & second(now) 'Create instance of Altiris NSE component dim nse 'set nse = WScript.CreateObject ("Altiris.AeXNSEvent") set nse = 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 'Insert custom Data Class here set objDCInstance = nse.AddDataClass ("{insert Class here }") dim objDataClass set objDataClass = nse.AddDataBlock (objDCInstance) 'Add a new row dim objDataRow set objDataRow = objDataClass.AddRow 'Set columns objDataRow.SetField 0, LabPC_QL objDataRow.SetField 1, LabPC_OWNER objDataRow.SetField 2, LabPC_LOCATION objDataRow.SetField 3, LabPC_SITE objDataRow.SetField 4, LabPC_DEPUTY objDataRow.SetField 5, LabPC_SoftFilter objDataRow.SetField 6, LM nse.SendQueued
Regards
John
How would I do this with trying to inventory a registry key?
Very good & useful viedo.
Thanks.
Hi, Symantec's backline technical support strongly recommends using the dataclass name rather than guid in custom inventory scripts. There are various circumstances that can cause the guid to change, i.e., hierarchy. Using the name will always work regardless of the value of the data class guid. Here's an example:
set objDCInstance = nse.AddDataClass ("CimDataFile")