Quantcast
Channel: Symantec Connect - Endpoint Management - Discussions
Viewing all articles
Browse latest Browse all 6689

Custom inventory script help?

$
0
0
I need a solution

So I have a custom data class that has been working great with a vbscript I created to grab the custom inventory from windows 7 pc's  It essentially grabs about 15 registry entries.

We needed to add one more, so I added an attribute to the custom data class and updated the inventory script to pull one more registry key.  For some reason this key is not being grabbed.  I get no errors from the script and if I change any of the other registry keys and run the script it will update the database, but just will not import the new data for the new attribute???   The attribute shows up when I go into resource manager and look at the data class for the pc that im checking out, but its blank.  If I throw a msgbox command in the vbscript it is pulling it to the MEID variable, so I'm guessing its on the backend?  any thoughts?  Is there a way I can see the NSE before it sends it so I can see the data in it?  I removed the send command but couldn't find it anywhere.

Here is my script that I am using to pull the data, the attribute I added is MEID

 

'Start Script Here

On Error Resume Next
'Create instance of Wbem service object, connect to namespace and run wmi query
strComputer = "."
'Set objWMIService = GetObject("winmgmts:"& "{impersonationLevel=impersonate}!\\"& strComputer & "\root\cimv2")
'Set objCIMObj = objWMIService.ExecQuery("select * from win32_useraccount")
 
Dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
 
'Create instance of Altiris NSE component and set the header data of the NSE
dim nse
set nse = WScript.CreateObject ("Altiris.AeXNSEvent")
 
' Please don't modify this GUID. This is the 'Inventory Capture Item'. 
nse.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}"
nse.Priority = 1
 
'Create Inventory data block. 
'Change the following guid. This is the guid of associated custom inventory dataclass.
dim objDCInstance
set objDCInstance = nse.AddDataClass ("{3b004039-1325-4e3c-a3d6-6ecc5d940b7e}")
dim objDataClass
set objDataClass = nse.AddDataBlock (objDCInstance)
 
 
Const HKEY_LOCAL_MACHINE = &H80000002
 
strComputer = "."
 
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"& _
 strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SOFTWARE\CorpRegKey\"
objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
  
For Each Subkey in arrSubKeys
 
strSubkeyPath = strKeyPath & Subkey
 
dim objDataRow
set objDataRow = objDataClass.AddRow
   
'Read Attributes from Registry
RegRead = "HKLM\"& strKeyPath & Subkey

Build = objShell.RegRead (RegRead & "\Build")
BuildTech = objShell.RegRead (RegRead & "\BuildTech")
DepartmentNumber = objShell.RegRead (RegRead & "\DepartmentNumber")
ImageCutDate = objShell.RegRead (RegRead & "\ImageCutDate")
ImageDate = objShell.RegRead (RegRead & "\ImageDate")
IMG_Server = objShell.RegRead (RegRead & "\IMG_Server")
JobRole = objShell.RegRead (RegRead & "\JobRole")
JoinOU = objShell.RegRead (RegRead & "\JoinOU")
Make = objShell.RegRead (RegRead & "\Make")
Model = objShell.RegRead (RegRead & "\Model")
PrimaryRACFID = objShell.RegRead (RegRead & "\PrimaryRACFID")
SR = objShell.RegRead (RegRead & "\SR")
TRC = objShell.RegRead (RegRead & "\TRC")
Type1 = objShell.RegRead (RegRead & "\Type")
WorkstationUse = objShell.RegRead (RegRead & "\WorkstationUse")
MEID = objShell.RegRead (RegRead & "\MEID")
 
objDataRow.SetField 0, Build
objDataRow.SetField 1, BuildTech
objDataRow.SetField 2, DepartmentNumber
objDataRow.SetField 3, ImageCutDate
objDataRow.SetField 4, ImageDate
objDataRow.SetField 5, IMG_Server
objDataRow.SetField 6, JobRole
objDataRow.SetField 7, JoinOU
objDataRow.SetField 8, Make
objDataRow.SetField 9, Model
objDataRow.SetField 10, PrimaryRACFID
objDataRow.SetField 11, SR
objDataRow.SetField 12, TRC
objDataRow.SetField 13, Type1
objDataRow.SetField 14, WorkstationUse
onjDataRow.SetField 15, MEID
 
Next
 
nse.SendQueued

1405633096

Viewing all articles
Browse latest Browse all 6689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>