Last year I blogged about how to add Lenovo and HP warranty information to Configuration Manager 2012, you can find this blogpost here.
Since that HP have changed their warranty lookup website so the script in the previous blogpost has stopped working. Yes the script solution is dependent on the output from the webpage to provide the information, so if the webpage change, the script most likely will stop to function again. But I’ve rewritten the scripts to make it easier to adjust if this happens.
You can download the updated scripts here; HP – Lenovo – Dell
To implement this solution you can follow the steps below.
- You need to change the sCompanyName variable in the scripts to what you want, in the screenshot below I’ve changed it to ThinkIT Solution that is my lab “company”. You also have the option to disabel logging.
We then need to create a .MOF file so we can configure Configuration Manager 2012 R2 to collect the warranty information through Hardware Inventory.
- First you’ll need to download Mark Cochrane’s RegKeytoMof 3.1 from here and run it on a computer where you have already executed the script file. Then you’ll need to locate the registry keys you want to inventory as shown in the screenshot below;
- Browse to the following folder <Configuration Manager Install Directory>\inboxes\clifiles.src\hinv and make a copy of the configuration.mof file.
- Open the configuration.mof file and browse to the end of the file and look for the following content
//======================== // Added extensions start //======================== //======================== // Added extensions end //========================
Copy and paste the content from the configuration.mof tab between the Added extensions start and Added extensions end and save the configuration.mof file.
- Select the “to import in Admin/Agent settings…” tab of the tool and copy the content and paste into a Notepad file that you save with a .mof extention.
- Open the Configuration Manager Console -> Administration Workspace -> Client Settings and open Default Client Settings.Select Hardware Inventory and click on Set ClassesClick on Import.. and select the .mof file created in step 4. You’ll then be presented with the Import Summary Screen where you click on Import
- By default the imported class will be selected and since this is the Default Client Settings it will apply to all systems if that is fine for your environment just click OK. But in this guide we’ll de-select it and at it just for the Custom Client Settings, do I de-select it and click OK twice.
- I then open the the THI – Custom Client Device Settings that applies to the clients I would like to inventory the Warranty Information from select the Hardware Inventory and click on Set Classes. Here you can scroll down to or search for Warranty and select it and click on OK twice.
So we have now configured Configuration Manager 2012 R2 to collect the Warranty Information, we now need to run the Warranty scripts on the clients, this can be done as an application or a package for existing systems that are already deployed or we can do it in the Task Sequence so all systems runs the script when they are deployed. I’m gonna walk you throug the process of setting this up in a Task Sequence in this post.
- First we need to create a package that holds the warranty check scripts. Go to the Software Library workspace and expand Application Management, right click Packages and select Create Package and the Create Package and Program Wizard will start. Fill out the information on the first screen as shown below and click next. (The source folder contains just the 2 vbscript files, HP.vbs and Lenovo.vbs)
- On the Program Type pane select Do not create a program and finish the wizard.
- Distribute the package to your Distribution Points.
- Open your Task Sequence and create a Group called Warranty Check.
- Add a new Run Command Line Step and give it a name, I’ve used HP – Set Warranty Information. In the command line section type in cscript.exe HP.vbs and select the Package we created in step 1. You should have something like the screenshot below;
- Click on the Options tab and click on Add Condition and select Query WMI and paste in the following WQL Query: SELECT * FROM Win32_ComputerSystem WHERE Model LIKE “%HP%” (This will make sure that this step only runs on HP systems)
- Add a new Run Command Line Step to the Warranty Check group and give it a name, Lenovo – Set Warranty Information. In the command line section type in cscript.exe Lenovo.vbs and select the Package we created in step 1. You should have something like the screenshot below;
- Click on the Options tab and click on Add Condition and select Query WMI and paste in the following WQL Query: SELECT * FROM Win32_ComputerSystem WHERE Manufacturer LIKE “LENOVO” (This will make sure that this step only runs on Lenovo systems)
When we deploy a new system now it will run the warranty check as part of the OSD process, and when the OSD process is complete we can find the following information on the client;
In C:\Windows\Temp\WarrantyInfo.log :
And after Hardware Inventory process has completed on the client we can see the following from the Resource Explorer inside the Configuration Manager console:
All information is also stored in a SQL View in the Configuration Manager Database so you can create reports from this information: (You can find an example query for a report in my previous posting)
Any feedback is appreciated so feel free to leave a comment 🙂
Update 1
There has been several request for a simillar solutions for Dell computers, so one can cover all systems with the same script solution. So today I’ve made available a warranty script for Dell computers also. That you can download here; Dell. As always feedback is appreciated.
I’ve tried the HP.vbs script and get an error;
HP.vbs(140, 2) Microsoft VBScript runtime error: Subscript out of range: ‘[number: 1]’
Just tested on my HP laptop to check the log and registry entries before modifying the MOF etc…
Hi Paul,
I’ve tested the script on 7 different HP models and several computers of each model with no issues. Could be that you get a different output on the webpage. (Do you know if there are added some extra warranty options to the computer you are testing on.)
If you want to share the the ProductNumber and Serial with me I can take a look at your case and make the adjustments needed for it to function properly. (You can send me a DM on twitter with the information if you want @oddmk79)
Hello Odd-Magne,
Sorry for the late response;
HP EliteBook 8570w
5CB3160VDB
Thanks
Hi again Paul,
I’ve checked this now and everything works ok when I test this here. You can see the result in the logfile here; https://sccmguru.files.wordpress.com/2014/04/1.jpg
You do have internet connection on the computer you try to run this script?
Have you checked the logfile? (C:\Windows\Temp\WarrantyInfo.log)
Can you try and open this URL to verify that you can access warranty information page: http://h10025.www1.hp.com/ewfrf/wc/weResults?lc=en&dlc=en&cc=th&tmp_weCountry=us&tmp_weSerial=5CB3160VDB&tmp_weProduct=B9D05AW#AK8
Hello Odd-Magne,
Yes I have a internet connection and able to access the warranty information page URL you provided. However in the warrantyinfo.log I notice the URL is slightly different when I run the script.
*********************************************************
5/5/2014 8:05:35 AM Beginning warranty information lookup.
5/5/2014 8:05:35 AM Serial number of system is 5CB3160VDB
5/5/2014 8:05:36 AM Product number of the system is C3Z12EC#ABA
5/5/2014 8:05:36 AM Operating system is 64 bit.
5/5/2014 8:05:36 AM Opening the web site URL http://h10025.www1.hp.com/ewfrf/wc/weResults?lc=en&dlc=en&cc=th&tmp_weCountry=us&tmp_weSerial=5CB3160VDB&tmp_weProduct=C3Z12EC#ABA
5/5/2014 8:05:39 AM Successful response from the web site.
5/5/2014 8:05:39 AM Processing the HTML returned from the site.
5/5/2014 8:05:39 AM Registry key path is HKLM\SOFTWARE\CompanyName\WarrantyInformation
5/5/2014 8:05:39 AM Setting registry values.
*********************************************************
Difference is; weProduct=C3Z12EC#ABA
Error;
hp.vbs(140, 2) Microsoft VBScript runtime error: Subscript out of range: ‘[number: 1]’
Hi,
reason for the difference in link is that I had to pick a productnumber, since I only had the serial.
If I manually go to the Warranty Lookup page and enter your details Serial/Product number I don’t recive any information, so that’s the reason for the script returning the error. You can check manually here; http://h10025.www1.hp.com/ewfrf/wc/weInput?cc=us&dlc=en&lc=en
It’s on my to-do list to add some error handling to the script.
Well I tried the manual process and it didn’t return any warranty data with the serial and product numbers. I then tried the “Automatic product detection and warranty check” it found the serial and product numbers, I click check warranty status and again nothing.
wierd…. So it’s definitely not the script in the situation.
So I see on the page;
HP Products that cannot be automatically detected
The following product categories can not be detected:
Digital cameras
non-Ipaq Handhelds/Smartphones
Calculators
Keyboards, accessories, and options
Monitors and flat panels
Printer supplies
Servers
Software
Storage
Workstations <– I have a workstation
[…] https://sccmguru.wordpress.com/2014/04/24/hp-and-lenovo-warranty-information-in-configuration-manager… […]
Hi, I’m getting this error in report:
Conversion failed when converting date and/or time from character string..
Can you help me?
Thanks
I have used these scripts in the past and never know where they came from. I just wanted to say thanks for making the available!
How do you push this as a command to existing machines? When i create a package and push to the clients, SCCM reports success, but when checking the client, the registry entries are not written and there is no log file.
I am also having this issue when I push this out as a Package or even during task sequence it is running but getting the following error:
*********************************************************
8/26/2014 5:01:57 PM Beginning warranty information lookup.
8/26/2014 5:01:57 PM Serial number of system is XXXXXXXX
8/26/2014 5:01:57 PM Operating system is 32 bit.
8/26/2014 5:01:57 PM Opening the web site URL https://api.dell.com/support/v2/assetinfo/warranty/tags.xml?svctags=XXXXXXXX&apikey=1adecee8a60444738f280aad1cd87d0e
8/26/2014 5:02:22 PM ERROR: the web site returned status code System error: -2146697191.
8/26/2014 5:02:22 PM Returning exit code 1.
*********************************************************
But if I run the script myself it runs fine everytime.
Thoughts?
[…] https://sccmguru.wordpress.com/2014/04/24/hp-and-lenovo-warranty-information-in-configuration-manager… […]
I’ve been trying to get your Warranty Info scrape working, but nothing ever shows up in SCCM or SQL Server. I can look on the clients and see the vbscript ran, created WarrantyInfo.log and registry entries, but when the hardware inventory runs, it never makes it into SCCM (as far as I can tell).
InventoryAgent.log has some failures, but it doesn’t say what specific hardware classes failed. How do I go about debugging this?
I drilled down into the InventoryAgent.log for one of the machines and discovered this line:
Collection: Class “WarrantyInformation” does not exist.
What does this mean? What did I miss?
Anyone know why I get the following error when running the hp.vbs script:
—————————
Windows Script Host
—————————
Script: C:\HP.vbs
Line: 67
Char: 1
Error: 0x8004100C
Code: 8004100C
Source: (null)
—————————
OK
—————————
got any info ont that error? i got the same thing 😦
This is really nice 🙂 But do You have a vbs for Intel NUC computers???
Any way to get this written so the output is put into a CSV instead of the registry? I’d love to be able to pull warranty info en masse without doing it through SCCM.
Is it possible to change the date format to YYYY-MM-DD ?
Yes, this should be possible either by editing the script or adjust the output when you write the SQL query.
Dell script creates “Expiration Date”, HP script creates “ExpirationDate”
Im running into Microsoft VBScript runtime error: Subscript out of range: ‘[number: 1]’ line 128 character 2. on the lenovo script. This occurs even if im running it manually VS as a package.
according to notepad this is the line affected:
SerialNumber = split(xmlhttp.responseText,”Serial number:”)(1)
I am unable to determine what is wrong.
Thank You for the script, and working well with SCCM. However, what I didn’t realise until after I deployed the script via SCCM, the reg keys get written to Wow6432Node rather than HKLM\Software if ran manually. No big deal, just had to edit the output of RegKeytoMOF in configuration.mof.
The real issue for me, I’ve deployed the vb script via SCCM as a package and a lot of the devices get to opening the website URL and stop there, not all but certainly the majority. They do have an Internet connection. Should I be running this with user rights or admin rights? Any ideas?
Thank You,
Lenovo seems to have changed their website to csp.lenovo.com, Also it seems to fail to parse the result for newer machines with the longer model numbers?
It appears that Lenovo has changed the lookup process to require an manual input to a manual CSV upload. Manual. UGGHH!!
I meant to type:
It appears that Lenovo has changed the lookup process to require a manual input OR a manual CSV upload. Manual. UGGHH!!
I found this after searching:
It’s powershell and I’d like to get or figure out how to write a vbs version too.
$test = Invoke-WebRequest -uri http://support.lenovo.com/us/en/warrantylookup -SessionVariable ln
$form = $test.forms[4]
$form.Fields[“serialCode”]=”MJCTV84″
$answer = Invoke-WebRequest -Uri (“http://support.lenovo.com” + $form.Action) -WebSession $ln -Method $form.Method -Body $form.Fields
$answer.AllElements|where class -eq “reset”|Select -First 1 -ExpandProperty innerText
https://social.technet.microsoft.com/Forums/scriptcenter/en-US/76d24b85-7ce3-497c-973e-beece6c68ed3/get-lenovo-warranty-info-automatically?forum=winserverpowershell
change API Key for Dell :
http://www.sysadminsblog.com/scripting/powershell/dell-warranty-information-api/
The lenovo script no longer works. It fails with internal server error 500, i’m guessing that lenovo don’t want us to use it. So i did a rewrite of the script to powershell and got it working. If you are interested, I can share here.
To have Dell warranty script running again change to the following in script:
sParameters = “&apikey=849e027f476027a394edd656eaef4842”
Error:
Dell.vbs(81, 1) msxml3.dll: Access is denied.
The only thing I changed was the company name so far.
HP script works, it just is not writing to the registry. I can tell its working through the log file… Not sure why it wont write, I’m running as local admin…
[…] This method was inspired by this brilliant post – https://sccmguru.wordpress.com/2014/04/24/hp-and-lenovo-warranty-information-in-configuration-manage… […]
I continue to run into errors with the VBscript not able to pull the Product Number. Happening with both new and old machines. Any thoughts?
Hi,
I’m having the same issue, seems the address in the script isn’t working any more…any thoughts on the new link?
Please the script no respond for website maybe the the web page its update??
HI,
Seems like HP changed the link. Any idea on how to retrieve the new link?
Hi,
It seems the HP link has changed, at least it gets stuck for us at the moment, any way to find the “new” link?
TIA
Anderz
Hi,
It seems that the link for HP might have changed, any suggestions on retrieving the new link?
TIA
Hey,
looks like as if HP changed something?
The url I’m getting sends me now to http://support.hp.com/us-en
Will you be able to fix it?
regards, Roland
Hi,
you have feedback on my feedback? 🙂
cheers, roland
Hi,
It looks lik HP changed their warranty URL.
Can you check please?
The download links no longer work in this post.
Scripts link is broken, could you please re upload the Scripts
new script for latest HP page changes 24.05.2016
http://s000.tinyupload.com/download.php?file_id=35787357943660528901
Don’t know if the first post worked
new script for latest HP page changes 24.05.2016
regards
http://s000.tinyupload.com/download.php?file_id=35787357943660528901
new script for latest HP page changes
regards
http://s000.tinyupload.com/?file_id=35787357943660528901
the link http://h10025.www1.hp.com/ewfrf/wc/weResults?lc=en&dlc=en&cc=th&tmp_weCountry=us&tmp_weSerial=MXL4310LFY&tmp_weProduct=E2D14AV#092 no work,
Your link to your Powershell scripts are now dead. Can you repost your Powershell scripts? Thank You.
Hi, the link to download the script is failing.
Download Lenovo script is broken
the “You can download the updated scripts here; HP – Lenovo – Dell” Lenovo link does not work – OneDrive – file no longer exists
Script for non Enterprise Products:
https://www.dropbox.com/s/svug453jxcq7ryi/hp.vbs?dl=0
regards
this should work for enterprise
https://www.dropbox.com/s/xkrae6qfzpc8frf/hp_E.vbs?dl=0
Thanks s0mm3r!
Anyone have this working for Lenovo?
Do you have an updated Dell script, by chance?
Hi,
Would you still have the powershell script for Lenovo?
It is no longer available on OneDrive….
Thanks in advance
Is this still working?
Wasn’t sure if Hp adding the captcha would break it.
please share the lenovo & Dell script download link
anyone have script to share?
Download onedrive site is broken
need your help, please share the download link for Lenovo & Dell warranty information script
Any chance of another version? Looks like HP have made another change, and this script no longer works.
http://h20566.www2.hp.com/hpsc/wc/public/find?rows%5B0%5D.item.productNumber=L1G76AV&rows%5B0%5D.item.countryCode=AT&submitButton=Senden&rows%5B0%5D.item.serialNumber=CZC646B2GN&hpeuck_locale_ar=at&lang=de
Hi! Has anyone managed to update the HP script for non-Enterprise products? I’ve got a decent working URL, but I’m struggling with the section that parses the response and gives the warranty end date.
Does anyone have currently working scripts for any or all of the 3 major brands?
Hello 🙂
Great article! Any chances please to update the links to scripts please? All are gone 😐
Thank you!
Best regards,
m.
[…] HP and Lenovo Warranty Information in Configuration Manager 2012 R2 […]