HP and Lenovo Warranty Information in Configuration Manager 2012 R2

Posted: April 24, 2014 in Configuration Manager, System Center Configuration Manager 2012
Tags: , ,

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.

  1. 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.
    1

We then need to create a .MOF file so we can configure Configuration Manager 2012 R2 to collect the warranty information through Hardware Inventory.

  1. 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;
    2
  2. Browse to the following folder <Configuration Manager Install Directory>\inboxes\clifiles.src\hinv and make a copy of the configuration.mof file.
    20
  3. 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.9

  4. 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.
  5. Open the Configuration Manager Console -> Administration Workspace -> Client Settings and open Default Client Settings.3Select Hardware Inventory and click on Set Classes4Click 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 Import6
  6. 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.7
  7. 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.8

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.

  1. 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)10
  2. On the Program Type pane select Do not create a program and finish the wizard.11
  3. Distribute the package to your Distribution Points.
  4. Open your Task Sequence and create a Group called Warranty Check.
  5. 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;12
  6. 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)13
  7. 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;14
  8. 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)15

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 registry:16

In C:\Windows\Temp\WarrantyInfo.log :17

And after Hardware Inventory process has completed on the client we can see the following from the Resource Explorer inside the Configuration Manager console:18

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)19

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.

About these ads
Comments
  1. Paul M says:

    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)

  2. Paul Murray says:

    Hello Odd-Magne,

    Sorry for the late response;

    HP EliteBook 8570w
    5CB3160VDB

    Thanks

  3. Paul Murray says:

    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]‘

  4. Paul Murray says:

    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

    • Gonçalo says:

      Hi, I’m getting this error in report:
      Conversion failed when converting date and/or time from character string..

      Can you help me?

      Thanks

  5. Gary Smith says:

    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!

  6. david says:

    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.

    • Cory Freeman says:

      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?

  7. Branden long says:

    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?

  8. Branden Long says:

    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?

  9. Jonathan says:

    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
    —————————

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s