Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Soap Request - Dell Warranty script

Created: 05 Sep 2012

I have gotten the script for checking Dell Warranty to work but the following fields always show blank after the soap request, is there anyway I check what field names should be as without this information I do not know what how many days I have left for services ie: Prosupport, parts only etc?

These attributes are blank:

'strsld = warrantyCols.SelectSingleNode("Description").text
'WScript.echo "ServiceLevelDescription: " & strsld
'strprv = warrantyCols.SelectSingleNode("Name").text
'WScript.echo "Name: " & strprv



Working Script below:

'Create Inventory data block using the GUID of the custom inventory data class created on the NS
dim objDCInstance
set objDCInstance = nse.AddDataClass ("{5883f7d4-92e8-4fe2-b2b4-cee9c4fdd07b}")
dim objDataClass
set objDataClass = nse.AddDataBlock (objDCInstance)
SoapRequest = "<?xml version=""1.0"" encoding=""utf-8""?> <soap:Envelope xmlns:xsi="""" xmlns:xsd="""" xmlns:soap=""""> <soap:Body> <GetAssetInformation xmlns=""""> <guid>11111111-1111-1111-1111-111111111111</guid> <applicationName>AssetService</applicationName> <serviceTags>!SERVICETAG!</serviceTags> </GetAssetInformation> </soap:Body></soap:Envelope>"

url = ""
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)
on error Resume next
wscript.echo "Service Tag: " & svctag
SoapRequest = Replace(SoapRequest, "!SERVICETAG!", svctag)
Set objHTTP = CreateObject("Msxml2.XMLHTTP") "POST", URL, false
objHTTP.setRequestHeader "Content-Type", "text/xml"
objHTTP.setRequestHeader "SOAPAction", ""
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("Description").text
'WScript.echo "ServiceLevelDescription: " & strsld
'strprv = warrantyCols.SelectSingleNode("Name").text
'WScript.echo "Name: " & 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 0, strent
objDataRow.SetField 1, strstd
objDataRow.SetField 2, strend
objDataRow.SetField 3, strdl

'if IsNull(strEndDateValue) then
' objDataRow.SetField 2, "0"
' objDataRow.SetField 2, strEndDateValue
'end if

'if IsNull(strEntitlementTypeValue) then
' objDataRow.SetField 3, "0"
' objDataRow.SetField 3, strEntitlementTypeValue
'end if

'if IsNull(strProviderValue) then
' objDataRow.SetField 3, "0"
' objDataRow.SetField 3, strProviderValue
'end if

'if IsNull(strStartDateValue) then

' objDataRow.SetField 3, "0"
' objDataRow.SetField 3, strStartDateValue
'end if
'Send nse to altiris server