Client Management Suite

 View Only
  • 1.  No entries in table for Custom Data Class

    Posted Jul 31, 2012 04:28 AM

    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>
     

     



  • 2.  RE: No entries in table for Custom Data Class

    Posted Aug 03, 2012 12:00 AM

    Well assuming your script is valid, one problem I see is you have the "on Error Resume Next" commented out; in the case where the shell.RegRead fails, the script will also throw an error and fail, and your If Err <> 0 bit will not execute (and the script will abort). So, I don't think  you'll ever get any details if the patch is NOT installed.

    Another question...does this hotfix not show up in regular Inventory (i.e. Add/Remove Programs)?  That might be an easier way to target machines needing the fix.  Or you can do an Applicability rule (I haven't gotten into those myself yet, but seems like just what you need).



  • 3.  RE: No entries in table for Custom Data Class

    Posted Aug 06, 2012 03:55 AM

    Hi KSchroeder,

    thanks for the reply. The "On error ..." was active, I've commented it out for testing and debugging. And yes it would be much easier if the hotfix was listed in the Add/Remove programs list....but unfortunately it isn't.

    I've been running this script daily, both scheduled and manual on several systems but with no effect whatsoever :(

     

     

     


     



  • 4.  RE: No entries in table for Custom Data Class
    Best Answer

    Posted Aug 06, 2012 04:41 AM

    Hi Walter81,

    I scanned your script and also had a problem with the data class name for some reason it does not update the DB with the values,

    Below is a script I used for custom inventory just change the strkey1 regRead and the GUID for the dataclass.

    Dim WshShell, strkey1
    Set WshShell = WScript.CreateObject("WScript.Shell")


    strkey1 = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\LegalNoticeText")

    '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. Here assumption is that the data class with below guid is already configured on server
    dim objDCInstance
    set objDCInstance = nse.AddDataClass ("{aa5a8420-a3d7-4899-8cc7-ec8a2eefe032}") 'Change this GUID to Your GUID

    dim objDataClass
    set objDataClass = nse.AddDataBlock (objDCInstance)


    'Add a new row
    dim objDataRow
    set objDataRow = objDataClass.AddRow
    'Set columns
    objDataRow.SetField 0,strkey1


    nse.SendQueued



  • 5.  RE: No entries in table for Custom Data Class

    Posted Aug 09, 2012 02:57 AM

    somehow, for some reason it started working without a change (well, tiny change: I reverted back to using the GUID in stead of the Dataclass name).

    Thanks for the responses!