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

CUSYOM INVENTORY SCRIPT VB and Powershell

$
0
0
I need a solution

Am not getting any data posted from custom inventory I created.

'Following is a custom inventory sript gathering information about Java Runtime Environment of a machine and posting data
'to NS using Altiris NSE Component
'===================================================================================================================
On Error Resume Next

const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject( _
   "winmgmts:{impersonationLevel=impersonate}!\\"&_
    strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\JavaSoft\Java Runtime Environment"
strValueName1 = "Java7FamilyVersion"
strValueName2 = "Java6FamilyVersion"

oReg.GetStringValue _
   HKEY_LOCAL_MACHINE,strKeyPath,strValueName1,stringJava7FamilyVersion
oReg.GetStringValue _
   HKEY_LOCAL_MACHINE,strKeyPath,strValueName2,stringJava6FamilyVersion
if isnull(stringJava7FamilyVersion) then
  stringJava7FamilyVersion= "missing"
end if

if isnull(stringJava6FamilyVersion) then
  stringJava6FamilyVersion = "missing"
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. Here assumption is that the data class with below guid is already configured on server
dim objDCInstance
set objDCInstance = nse.AddDataClass ("{ec0aba6b-73e7-4854-968a-bfc4a3505b66}")

dim objDataClass
set objDataClass = nse.AddDataBlock (objDCInstance)

'Add a new row
dim objDataRow
set objDataRow = objDataClass.AddRow
'Set columns
objDataRow.SetField 0, stringJava7FamilyVersion
objDataRow.SetField 1, stringJava6FamilyVersion
nse.SendQueued

Any Ideas why?

Condidered trying this with POwershell but not reall sure to how to go about it besdides the query part

Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{81BE0B17-563B-45D4-B198-5721E6C665CD}" -Name Displayversion,DisplayName

Any help is appreciated

 

 


Viewing all articles
Browse latest Browse all 6689

Trending Articles



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