I currently have about 4300 end points. About 95% are Dell machines.
To date, we have no easy way to pull warraty info, other than exporting specific queries and copying the Service Tags into another script.
I would like to deploy a script (local and via gateway) that will query the device service tag; go to Dell and check warranty info; and report that info into the registry.
I have this VBS (copied below and attached) (courtesy of http://iboyd.net/index.php/2012/02/14/updated-dell-warranty-information-script/)
I remarked out all the wscript.echo in my actual script that I have run.
This prevents the series of pop ups.
When I run this local (from desktop or network source) it works perfect.
I get a series of registry keys under HKLM\Software\DellWarrantyInfo that provide me all the warranty info I'm looking for.
When I deploy this to targets as a "Windows Script Host" it doesn't seem to run.
I have tried without the remarked out lines and with full UI. I get prompted to Deploy, but nothing runs.
We will build this into our future templates for imaging, but I'd really like to get this info into the registry for existing machines.
Any help you can provide, I'd be greatful.
Thanks!
-Derek
'=====================================================================
' Dell Warranty Grabber
' Author: Matthew Boyd (iboyd.net)
' Date: 2/14/2012
'
' This is an example of how to query the Dell asset information
' web service for warranty information and parse the XML result.
' values are then written to the registry of the local
' computer. FYI: Sometimes, the web service doesn't return any
' entitlements (warranties), but then returns them after
' subsequent requests.
'
' Usage: cscript.exe DellWarrantyGrabber.vbs
'
' Note: This must be run under an account with admin rights.
' This script is provided AS IS with no support or warranties.
' Use at your own risk!
'=====================================================================
Option Explicit
Dim SoapRequest
Dim url, regkey, svctag
Dim warrantyRows, warrantyCols
Dim objShell, objXML, objWMI, objHTTP, NodeList
Dim i, result
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>Warranty Information Lookup</applicationName> <serviceTags>!SERVICETAG!</serviceTags> </GetAssetInformation> </soap:Body></soap:Envelope>"
url = "http://xserv.dell.com/services/assetservice.asmx"
regkey = "HKEY_LOCAL_MACHINE\Software\DellWarrantyInfo"
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 dude!", "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)
result = objShell.Run("reg.exe delete '" & regkey & "' /f", true)
If not result = 0 then Err.Raise result, "Unable to delete registry key!", "Code " & result
result = objShell.Run("reg.exe create '" & regkey & "' /ve", true)
If not result = 0 then Err.Raise result, "Unable to delete registry key!", "Code " & result
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
wscript.echo objXML.xml
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)
wscript.echo Mid(warrantyCols.SelectSingleNode("ServiceLevelDescription").text,4)
objShell.regWrite regkey & "\" & i & "\", ""
objShell.regWrite regkey & "\" & i & "\Description", Mid(warrantyCols.SelectSingleNode("ServiceLevelDescription").text, 4)
objShell.regWrite regkey & "\" & i & "\Provider", warrantyCols.SelectSingleNode("Provider").text
objShell.regWrite regkey & "\" & i & "\Entitlement Type", warrantyCols.SelectSingleNode("EntitlementType").text
objShell.regWrite regkey & "\" & i & "\Start Date", Left(warrantyCols.SelectSingleNode("StartDate").text, 10)
objShell.regWrite regkey & "\" & i & "\End Date", Left(warrantyCols.SelectSingleNode("EndDate").text, 10)
objShell.regWrite regkey & "\" & i & "\Days Left", warrantyCols.SelectSingleNode("DaysLeft").text
Next