Hi I am using the following script as provided in the "Extending CMS with HW Mgmt of Dell Business Client Devices.pdf"
If I run the script the full script it displays a box with serial number, then 5 results returned. Then errors at line 54 with Error Object required: SelectSinglenode - strsld = warrantyCols.SelectSingleNode("ServiceLevelDescription").text
Any ideas as I'm not really a scripting person so understand the process but not the language
FULL SCRIPT
Get Dell Warranty
'==========================================================================
' GetDellWarranty.vbs
' This script will query WMI for the service tag of a Dell Machine, query Dell using a SOAP request
' to obtain warranty information, and return the information to the SMP using an NSE
'==========================================================================
Option Explicit
Dim SoapRequest
Dim url, regkey, svctag
Dim warrantyRows, warrantyCols
Dim objShell, objXML, objWMI, objHTTP, NodeList
Dim i, result
Dim strsld,strprv,strent,strstd,strend,strdl
'Create instance of Altiris NSE component
dim nse
set nse = WScript.CreateObject ("Altiris.AeXNSEvent")
'Set the header data of the NSE
'Don't modify this GUID
nse.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}"
nse.Priority = 1
'Create Inventory data block using the GUID of the custom inventory data class created on the NS
dim objDCInstance
set objDCInstance = nse.AddDataClass ("{5504c837-0a69-4274-8b54-bf8985fd1369}")
dim objDataClass
set objDataClass = nse.AddDataBlock (objDCInstance)
SoapRequest = "<?xml version=""1.0"" encoding=""utf-8""?> <soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""> <soap:Body> <GetAssetInformation xmlns=""http://support.dell.com/WebServices/""> <guid>11111111-1111-1111-1111-111111111111</guid> <applicationName>AssetService</applicationName> <serviceTags>!SERVICETAG!</serviceTags> </GetAssetInformation> </soap:Body></soap:Envelope>"
url = "http://xserv.dell.com/services/AssetService.asmx"
Set objShell = WScript.CreateObject("WScript.Shell")
set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
If InStr(UCase(objWMI.ExecQuery("Select Manufacturer From Win32_ComputerSystem").ItemIndex(0).Manufacturer), "DELL") = 0 then Err.Raise 2, "This is not a Dell computer and is not eligible for Dell Warranty lookup", "No Service Tag"
svctag = Trim(objWMI.ExecQuery ("Select SerialNumber from Win32_BIOS").ItemIndex(0).SerialNumber)
wscript.echo "Service Tag: " & svctag
SoapRequest = Replace(SoapRequest, "!SERVICETAG!", svctag)
Set objHTTP = CreateObject("Msxml2.XMLHTTP")
objHTTP.open "POST", URL, false
objHTTP.setRequestHeader "Content-Type", "text/xml"
objHTTP.setRequestHeader "SOAPAction", "http://support.dell.com/WebServices/GetAssetInformation"
objHTTP.send SoapRequest
result = objHTTP.responseText
Set objXML = CreateObject ("Msxml2.DOMDocument")
objXML.LoadXml result
If not objXML.SelectSinglenode ("//faultstring") is nothing then
Err.Raise 1, "Error:" & objXML.SelectSingleNode("//faultcode").text, Trim(objXML.SelectSingleNode("//faultstring").text)
End If
Set NodeList = objXML.SelectNodes("//Asset/Entitlements/EntitlementData")
wscript.echo NodeList.length & " results returned: "
For i = 0 to NodeList.length - 1
set warrantyCols = NodeList.item(i)
strsld = warrantyCols.SelectSingleNode("ServiceLevelDescription").text
WScript.echo "ServiceLevelDescription: " & strsld
strprv = warrantyCols.SelectSingleNode("Provider").text
WScript.echo "Provider: " & strprv
strent = warrantyCols.SelectSingleNode("EntitlementType").text
WScript.echo "EntitlementType: " & strent
strstd = warrantyCols.SelectSingleNode("StartDate").text
WScript.echo "Start Date: " & strstd
strend = warrantyCols.SelectSingleNode("EndDate").text
WScript.echo "End Date: " & strend
'strdl = warrantyCols.SelectSingleNode("DaysLeft").text
'WScript.echo "Days Left: " & strdl
'Populate nse data fields
dim objDataRow
set objDataRow = objDataClass.AddRow
objDataRow.SetField 0, strsld
objDataRow.SetField 1, strprv
objDataRow.SetField 2, strent
objDataRow.SetField 3, strstd
objDataRow.SetField 4, strend
'objDataRow.SetField 5, strdl
'if IsNull(strEndDateValue) then
' objDataRow.SetField 2, "0"
'else
' objDataRow.SetField 2, strEndDateValue
'end if
'
'if IsNull(strEntitlementTypeValue) then
' objDataRow.SetField 3, "0"
'else
' objDataRow.SetField 3, strEntitlementTypeValue
'end if
'
'if IsNull(strProviderValue) then
' objDataRow.SetField 3, "0"
'else
' objDataRow.SetField 3, strProviderValue
'end if'
'
'if IsNull(strStartDateValue) then
' objDataRow.SetField 3, "0"
'else
' objDataRow.SetField 3, strStartDateValue
'end if
Next
'Send nse to altiris server
nse.SendQueued