Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

a problem about custom inventory

Created: 24 Jun 2013 • Updated: 30 Jul 2013 | 5 comments
liaoyinfeng's picture
This issue has been solved. See solution.

 I have created a custom dataclass and modified the sample Windows custom inventory script for registry data - all of this was a lot simpler than I expected it to be. However, something isn't working, so obviously I've done something wrong. After running my custom inventory on a client, return value is incorrect.

custom inventory script:

'---------------------BEGIN CUSTOM SCRIPT FOR INFORMATION GATHERING-----------
const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Control Panel\Desktop"
strValueName = "ScreenSaverIsSecure"
objRegistry.GetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
'----------------------END CUSTOM SCRIPT FOR INFORMATION GATHERING------------
'----------------------NOTIFICATION SERVER ENTRY STARTS HERE------------------
dim nse
set nse = WScript.CreateObject ("Altiris.AeXNSEvent")
nse.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}" 'Never change this guid, it is needed by NS.
nse.Priority = 1
dim objDCInstance
set objDCInstance = nse.AddDataClass ("{8284a0ad-b37f-4c9b-b0ad-cb92f97d7401}") ' Change this to math the guid of the custom data class
dim objDataClass
set objDataClass = nse.AddDataBlock (objDCInstance)
dim objDataRow
set objDataRow = objDataClass.AddRow
objDataRow.SetField 0, strValueName
objDataRow.SetField 1, strValue
nse.SendQueued
'----------------------NOTIFICATION SERVER ENTRY ENDS HERE---------------------

registy.jpg

the return value
sql.jpg

Operating Systems:

Comments 5 CommentsJump to latest comment

AngelD's picture

Please give us the details of the data class

liaoyinfeng's picture

thanks for your reply,this is data class.

dataclass.jpg

liaoyinfeng's picture

ok,this is the data class

dataclass.jpg

AngelD's picture

2 things

1) who is set to run the custom inventory task?

should it be the SMA account then that user's HKCU registry hive will be used and not the user's registry hive that "ownes" the image in your original post.

2) You should set the "aa" property/field as key to prevent duplicate records when ever the value changes.

SOLUTION
liaoyinfeng's picture

yes .the task must be run by logined user. the problem is be resloved.

thank you very much .AngelD