It does not use WMI and here is the script:
Option Explicit
On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
Dim nse
Dim objDCInstance
Dim objDataClass
Dim objDataRow
Dim strKeyPath, strValue, oReg, WshShell
strKeyPath = "SOFTWARE\Campbell\Server Info"
'open registry provider
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
'Try reading the key
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,"function",strValue
'Catch the error
Select Case IsNull(strValue)
'Error Code 0 = 'success'
Case 0:
'Create instance of Altiris NSE component
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
set objDCInstance = nse.AddDataClass ("{acf84c3b-bacd-46ac-b221-5a5de074f441}")
set objDataClass = nse.AddDataBlock(objDCInstance)
'Add a new row
set objDataRow = objDataClass.AddRow
'Set columns
'Get function
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,"function",strValue
objDataRow.SetField 0, strValue
'Get primary business owner
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,"primary business owner",strValue
objDataRow.SetField 1, strValue
'Get primary it owner
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,"primary it owner",strValue
objDataRow.SetField 2, strValue
'Get backup itowner
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,"backup it owner",strValue
objDataRow.SetField 3, strValue
'Get backup business owner
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,"backup business owner",strValue
objDataRow.SetField 4, strValue
'Get post-reboot procedure
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,"post-reboot procedures",strValue
objDataRow.SetField 5, strValue
'Get pre-reboot procedure
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,"pre-reboot procedures",strValue
objDataRow.SetField 6, strValue
'Get upinxhours
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,"upinxhours",strValue
if (isNumeric(strValue)) then
objDataRow.SetField 7, strValue
else
objDataRow.SetField 7, "0"
End If
'Get notes
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,"notes",strValue
if (isnull(strValue)) then
objDataRow.SetField 8, ""
else
objDataRow.SetField 8, strValue
end if
'Get phase
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,"phase",strValue
if (isnull(strValue)) then
objDataRow.SetField 9, ""
else
objDataRow.SetField 9, strValue
end if
nse.SendQueued
Case Else:
'do nothing
End Select