Update 08/25/16: Both Dell and Lenovo functions have been updated and are currently working. API key in the Dell function may expire overtime and will need to be replaced.
Update 07/28/16: Looks like Dell has replaced their older warranty lookup service with a new API. I am currently in the process of re-writing the script and hope to have it online soon.
Update 02/25/16: Lenovo changed the way their warranty lookup pages works a few months ago. The script has been updated so that it works with those new pages.
Update 08/05/14: File is actually updated this time and now contains the fixes mentioned in previous update.
Update 07/25/14: Fixed Get-DellWarrantyInfo, It appears as if Dell changed the WSDL to point to an internal address. A workaround has been added. Redownload the script to get the correction.
Update 05/23/14: All lenovo warranty issues have been fixed (for now). Redownload the script if you have lenovo systems.
This package provides easy, scriptable access to Dell and Lenovo warranty information and includes an example on how it can be used to power ConfigMgr 2012 reports.
Back in 2011 I created a dell warranty powershell module that would use Dell’s web service to gather warranty info. Using that module I created two scripts that could be used with ConfigMgr to gather warranty data for reporting. Now that most people are using ConfigMgr 2012 I have had many requests to update them as they currently do not work.
In this new version a few things have changed.
- Lenovo support has been added. (Get-LenovoWarranty)
- This is an html scraper and might break in the future.
- Lenovo’s web servers are very sketchy.
- ConfigMgr 2012 support.
- The SQL script has been improved.
- Data is now stored in its own database.
- The script will only query for warranty info that is missing.
- The WMI hardware inventory script has been removed.
You can download the new scripts here: https://utexas.box.com/computerwarrantyinfo
This powershell module contains two functions that will allow you to gather warranty info from both Dell and Lenovo systems. The required info to look up the warranty information can be automatically gathered from the computer itself, or directly inputted. This module does not require ConfigMgr. Feel free to use this module in your own scripts if you desire.
get-DellWarranty [[-computer] <String>] [[-logFilePath] <String>] [-ServiceTagInput]
Example 1 – Get dell warranty information using a computer name
Example 2 – Get dell warranty information using a list of service tags
Get-Content .\servicetags.txt | Get-DellWarranty -ServiceTagInput
get-LenovoWarranty [[-computer] <String>] [[-logFilePath] <String>] [-TypeSerialInput]
Example 1 – Get Lenovo warranty information using a computer name
Example 2 – Get Lenovo Warranty information using a list of system types and serials.
Get-Content .\TypesAndSerials.txt | Get-LenovoWarranty -TypeSerialInput
This script will query the ConfigMgr database for Dell and Lenovo systems and store their warranty information in its own database using the Computer Warranty Info module. On subsequent runs only the systems that are still missing warranty info will be run. This script should be run on a regular schedule for best effect. This script has not been tested with ConfigMgr 2007.
- Run the following powershell using a user who has read permissions on the ConfigMgr database and the ability to create databases on the server itself.
.\ComputerWarrantyInfoSQL.ps1 -SqlServer mysqlserver.abc.def -SiteCode ABC
- Set this command to run on a schedule if you wish.
As we all know creating reports in ConfigMgr 2012 takes much more effort than it did in 2007. I have included an export of a very basic report for you to use as a starting point. I recommend changing it to suit your needs as it is very basic and mainly for example.
- Add your report viewer service account with read access to the database created by the sql script (ComputerWarranty).
create user 'yourreportvieweraccount' for login 'yourreportvieweraccount'
exec sp_addrolemember 'db_datareader', 'yourreportvieweraccount'
- Open Computer Warranty Info.rdl with report builder (use a user that has access to the ConfigMgr database)
- On the left, right click on data sources and hit add data source…
- In the Data source properties window, hit browse.
- Navigate the your report server’s configmgr_sitecode.
- Should look something like this: http://sqlserver/reportserver/ConfigMgr_sitecode
- Double click on the data source in the folder. It will have a unique guid as the name.
- Ok out of the dialog.
- Right click on dataset1 and goto properties.
- Make sure that Datasource1 is the selected data source.
- Do the same for dataset2.
- Go ahead and run the report. If you have no errors save the report to your report server.