Video Screencast Help
Give us your opinion and win with Symantec! Please help us by taking this survey to tell us about your experience with Symantec Connect, so that we can continue to grow and improve.  Take the survey.

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:

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
'----------------------NOTIFICATION SERVER ENTRY ENDS HERE---------------------


the return value

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.


liaoyinfeng's picture

ok,this is the data class


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.

liaoyinfeng's picture

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

thank you very much .AngelD