Server Management Group

 View Only

Creating Custom Inventory Video 

Nov 14, 2012 01:04 PM

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

Statistics
0 Favorited
0 Views
1 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Mar 05, 2015 03:16 AM

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

Mar 04, 2015 04:47 PM

How would I do this with trying to inventory a registry key?

Jan 31, 2013 03:52 AM

Very good & useful viedo.

 

Thanks.

Nov 14, 2012 04:41 PM

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")

 

Thanks. 

Related Entries and Links

No Related Resource entered.