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.
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;
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🙂
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.