I've created a custom data class as described in this article
- create custom data class "MSOffice2010KB2281463Installed" with one attribute (also named) "MSOffice2010KB2281463Installed". Data Type = string, size = 1, Key = Yes and Required = Yes.
- I've created a VB script that checks the registry for a given key and sets the value for the attribute to either 0 (key does not exist yet or value = 0) or the current key value
- When I run the script -by starting it manually or scheduling it as a job- it does not show any errors and I can see that it creates a new .tmp file in the directory C:\Program Files\Altiris\Altiris Agent\Queue\NS.ourdomain.com. The .tmp files also "disappears" when the inventory gets sent.
- When I check the database I can find the new table "inv_MSOffice2010KB2281463Installed", but the table is empty and remains empty
What must I do to fill this table or am I looking in the wrong place?
The script:
'Read the value of the MSOffice2010KB2281463Installed regkey and publish it to the custom dataclass MSOffice2010KB2281463Installed
'in NS using Altiris NSE Component
'===========================================================================
'On Error Resume Next
'Fetch data
Set WShell = CreateObject("WScript.Shell")
strValue = WShell.RegRead("HKLM\SOFTWARE\OurCompany\MSOffice2010KB2281463Installed")
If Err <> 0 Then
strValue = 0
End If
'=============================================================================
'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.
dim objDCInstance
'set objDCInstance = nse.AddDataClass ("{24d4aefa-0d67-4ce7-a728-41286fcb8702}") ''
MSOffice2010KB2281463Installed GUID
set objDCInstance = nse.AddDataClass ("MSOffice2010KB2281463Installed")
dim objDataClass
set objDataClass = nse.AddDataBlock (objDCInstance)
'Add a new row
dim objDataRow
set objDataRow = objDataClass.AddRow
'Set columns
objDataRow.SetField 0, strValue
nse.SendQueued
The resulting .tmp file looks like this:
<?xml version="1.0"?>
<message>
<to>{1592B913-72F3-4C36-91D2-D4EDA21D2F96}</to>
<priority>1</priority>
<msgId>{02DA1AB3-2AC1-4135-8375-347023C182FF}</msgId>
<time>20120731101122.286000-120</time>
<from>
<resource typeGuid="{493435F7-3B17-4C4C-B07F-C23E7AB7781F}" guid="{817316F5-E2E1-412A-9735-177F5D02C859}" name="My-Computer">
<key name="name.domain" value="My-Computer.ourdomain/>
<key name="fqdn" value="My-Computer.ourdomain.com"/>
<key name="uniqueid" value="msetBgh/YOLZYPKMgHenTA=="/>
<key name="uniqueid" value="x14Za5iykrTnMlTogboCKw=="/>
<key name="uniqueid" value="I5v5YmEzVqXQ0VvQeTHpyg=="/>
<key name="uniqueid" value="dBAugfjDn0FIc+vvioIowQ=="/>
</resource>
</from>
<body>
<inventory>
<dataClass name="MSOffice2010KB2281463Installed">
<data>
<resource partialUpdate="false">
<row c0="1" hash="Z3dlYTn0UbrjzaFgcea5/A=="/>
</resource>
</data>
</dataClass>
</inventory>
</body>
</message>