‎12-08-2009 04:43 PM
Dim objWMI : Set objWMI = GetObject("winmgmts:")
Dim colSettingsComp : Set colSettings = objWMI.ExecQuery("Select * from Win32_ComputerSystem")
Dim colSettingsBios : Set colSettingsBios = objWMI.ExecQuery("Select * from Win32_BIOS")
Dim objComputer, strModel, strSerial
For Each objComputer in colSettings
strModel = objComputer.Model
Next
For Each objComputer in colSettingsBios
strSerial = objComputer.SerialNumber
Next
myarray = Split(strModel, "(")
wscript.echo "Model: ", Replace(myarray(0),"(","")
wscript.echo "Part Number:", Replace(myarray(1),")","")
wscript.echo "Serial: ", strSerial
http://h20000.www2.hp.com/bizsupport/TechSupport/WarrantyResults.jsp?nickname=&sn={SERIALNUMBER}&country=CA&lang=en&cc=us&pn={PARTNUMBER}&find=Display%20Warranty%20Information%20%C2%BB&
http://h10025.www1.hp.com/ewfrf/wc/swPfinder?query={PARTNUMBER}&tool=softwareCategory&lc=en&cc=us&dlc=en
‎12-08-2009 06:47 PM
ComputerName = Wscript.Arguments(0)
winmgmt1 = "winmgmts:{impersonationLevel=impersonate}!//"& ComputerName &""
Set colSettings = GetObject( winmgmt1 ).InstancesOf ("Win32_ComputerSystem")
Set colSettingsBios = GetObject( winmgmt1 ).InstancesOf ("Win32_BIOS")
For Each objComputer in colSettings
strModel = objComputer.Model
Next
For Each objComputer in colSettingsBios
strSerial = objComputer.SerialNumber
Next
if instr(strModel, "dc") > 0 then
msgbox "HP partnumber not found!"
else if instr(strModel, "HP") > 0 then
myarray = Split(strModel, "(")
wscript.echo "Model Number: ", Replace(myarray(0),"(","")
wscript.echo "Part Number: ", Replace(myarray(1),")","")
wscript.echo "Serial Number:", strSerial
s=Replace(myarray(1),")","")
sEncoded=Escape(s)
Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("iexplore.exe http://h20000.www2.hp.com/bizsupport/TechSupport/WarrantyResults.jsp?nickname=&sn="& strSerial &"&country=CA&lang=en&cc=us&pn="& sEncoded &"&find=Display%20Warranty%20Information%20%C2%BB&", 1)
else msgbox "HP partnumber not found!"
end if
end if
ComputerName = Wscript.Arguments(0)
winmgmt1 = "winmgmts:{impersonationLevel=impersonate}!//"& ComputerName &""
Set colSettings = GetObject( winmgmt1 ).InstancesOf ("Win32_ComputerSystem")
Set colSettingsBios = GetObject( winmgmt1 ).InstancesOf ("Win32_BIOS")
For Each objComputer in colSettings
strModel = objComputer.Model
Next
For Each objComputer in colSettingsBios
strSerial = objComputer.SerialNumber
Next
if instr(strModel, "dc") > 0 then
msgbox "HP partnumber not found!"
else if instr(strModel, "HP") > 0 then
myarray = Split(strModel, "(")
wscript.echo "Model Number: ", Replace(myarray(0),"(","")
wscript.echo "Part Number: ", Replace(myarray(1),")","")
wscript.echo "Serial Number:", strSerial
Set WshShell = WScript.CreateObject("WScript.Shell")
s=Replace(myarray(0),"(","")
sEncoded=Escape(s)
Return = WshShell.Run("iexplore.exe http://h10025.www1.hp.com/ewfrf/wc/swPfinder?query="& sEncoded &"&tool=softwareCategory&lc=en&cc=us&dlc=en", 1)
else msgbox "HP partnumber not found!"
end if
end if
cscript.exe \\SERVER\lstools$\HPdrivers.vbs {computer}
cscript.exe \\SERVER\lstools$\HPwarranty.vbs {computer}
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now