Computer Warranty Info (Formerly Dell Warranty Info)

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

ComputerWarrantyInfoFunctions.psm1

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

Get-DellWarranty MyComputerName

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

Get-LenovoWarranty MyComputerName

Example 2 – Get Lenovo Warranty information using a list of system types and serials.

Get-Content .\TypesAndSerials.txt | Get-LenovoWarranty -TypeSerialInput

ComputerWarrantyInfoSQL.ps1

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.

Usage

  1. 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
    
  2. Set this command to run on a schedule if you wish.

The Report

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.

installation

  1. 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'
    
  2. Open Computer Warranty Info.rdl with report builder (use a user that has access to the ConfigMgr database)
  3. On the left, right click on data sources and hit add data source…
  4. In the Data source properties window, hit browse.
  5. Navigate the your report server’s configmgr_sitecode.
    1. Should look something like this: http://sqlserver/reportserver/ConfigMgr_sitecode
  6. Double click on the data source in the folder. It will have a unique guid as the name.
  7. Ok out of the dialog.
  8. Right click on dataset1 and goto properties.
  9. Make sure that Datasource1 is the selected data source.
  10. Do the same for dataset2.
  11. Go ahead and run the report. If you have no errors save the report to your report server.

warranty

Advertisements

18 thoughts on “Computer Warranty Info (Formerly Dell Warranty Info)

  1. trentliffick

    First off I love this idea and execution for the Computer Warranty Information! I’m really hoping to execute this in production to give me more information on our computers. However anytime I run the ‘Get-LenovoWarranty’ module I receive the following error: “WARNING: Error accessing warranty information for Type, Serial: x,y”.

    I can see the data in the database (for the computer I’m query), so I know it should be there. I’m running the powershell command as the same user that created the DB, so I don’t think permissions are an issue. Would you be able to help point me in the right direction?
    Thanks!!!

    Reply
    1. trentliffick

      I’ve learned that the issue appears to be with Lenovo’s website. You now are required to enter a code to validate you’re not part of SkyNet. This is causing the script to fail to gather the information via the web.
      Thanks for the script!

      Reply
      1. skeiffer Post author

        Sorry for the late response, I have known about this for awhile and have had it fixed for about a month internally. I have updated the download link with a fix.

      2. Michael

        I am running into the same issue now. Getting this: WARNING: Error accessing warranty Information for Type,Serial:. I have downloaded the latest scripts today and have tried it on different machines. No luck. Anyone have a fix for it?

    2. Joe Pintello

      Scott Have you resolved this issue yet?

      Computer Warranty Info (Formerly Dell Warranty Info)

      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.

      Reply
      1. Mosey Joe

        I run the script it creates the DB but generates this error:

        — Computer Warranty Info SQL population script —
        Obtaining list of systems…
        D:\Install\ComputerWarrantyInfoSQL.ps1 : There was a problem recieving the list of dell systems.
        + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
        + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,ComputerWarrantyInfoSQL.ps1

        D:\Install\ComputerWarrantyInfoSQL.ps1 : There was a problem recieving the list of systems with existing warranty information.
        + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
        + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,ComputerWarrantyInfoSQL.ps1

      2. skeiffer Post author

        Make sure the user you are running the script as has the permissions to run the query on line 76 in the SCCM database.

        Another potential error, your SCCM database name may not follow the default naming scheme (CM_sitecode). If that is the case you will need to edit $ConfigMgrDatabase on line 47.

      3. Mosey Joe

        it works now THANK YOU !!
        BTW I just inserted your function script in my existing script and it works great. Lets hope Dell doesn’t change it again anytime soon. This has been a moving target for me for many years now.

  2. vasile

    it seems the script does not work anymore.. getting this error Exception calling “GetAssetInformation” with “3” argument(s): “The remote name could not be resolved: ‘esupport.dellsvc'”

    Reply
  3. skeiffer Post author

    I have uploaded a fix. Basically the WSDL data changed and is now referring to an internal dell address that we cant resolve. I added code to manual set the correct address after the fact.

    Reply
    1. Tom Aguero

      I’m still getting the “Problem accessing webservice” with the new version. I am using the original SQL scripts for the SCCM 2007 version of the Dell only one but have updated it to point to the new ComputerWarrantyInfoFunctions.psm1

      Reply
  4. romaintiennot

    Hello there,
    I noticed a mistake in calculating the number of days remaining warranty.
    I have the problem according to the language of my operating system.
    Consider servicetag Dell 1TQN5Y1
    On a french operating system (Windows 8.1), I get 1046 .. On an English operating system (Windows Server 2008 R2), I get the same DaysLeft 1727 servicetag.
    This comes at the time of “Where-Object” and “Sort-Object”. The result is different between languages ​​OS. I did some echo:

    English OS:

    ServiceLevelCode :
    ServiceLevelDescription :
    Provider :
    StartDate : 27/06/2013 00:00:00
    EndDate : 28/06/2016 00:00:00
    DaysLeft : 681
    EntitlementType : Active

    ServiceLevelCode :
    ServiceLevelDescription :
    Provider :
    StartDate : 27/06/2013 00:00:00
    EndDate : 28/06/2016 00:00:00
    DaysLeft : 681
    EntitlementType : Active

    ServiceLevelCode :
    ServiceLevelDescription :
    Provider :
    StartDate : 27/06/2013 00:00:00
    EndDate : 28/06/2017 00:00:00
    DaysLeft : 1046
    EntitlementType : Active

    681
    0
    ok
    ———
    681
    681
    ———
    1046
    681
    ok
    ———
    ServiceTag : 1TQN5Y1
    SystemType : OptiPlex OptiPlex 9010
    Region : Europe
    Provider :
    ShipDate : 28/06/2013 02:00:00
    StartDate : 27/06/2013 00:00:00
    EndDate : 28/06/2017 00:00:00
    DaysLeft : 1727
    description :
    WarrantyExtended : True

    Fench OS :

    ServiceLevelCode :
    ServiceLevelDescription :
    Provider :
    StartDate : 27/06/2013 00:00:00
    EndDate : 28/06/2017 00:00:00
    DaysLeft : 1046
    EntitlementType : Active

    ServiceLevelCode :
    ServiceLevelDescription :
    Provider :
    StartDate : 27/06/2013 00:00:00
    EndDate : 28/06/2016 00:00:00
    DaysLeft : 681
    EntitlementType : Active

    ServiceLevelCode :
    ServiceLevelDescription :
    Provider :
    StartDate : 27/06/2013 00:00:00
    EndDate : 28/06/2016 00:00:00
    DaysLeft : 681
    EntitlementType : Active

    1046
    0
    ok
    ———
    681
    1046
    ———
    681
    1046
    ———
    ServiceTag : 1TQN5Y1
    SystemType : OptiPlex OptiPlex 9010
    Region : Europe
    Provider :
    ShipDate : 28/06/2013 02:00:00
    StartDate : 27/06/2013 00:00:00
    EndDate : 28/06/2017 00:00:00
    DaysLeft : 1046
    description :
    WarrantyExtended : True

    Solution :
    if($activeWarranties) {
    $Start = $warranties | Where-Object { ($_.EntitlementType -eq “Active” -or $_.EntitlementType -eq “Future”) -and $_.ServiceLevelCode -ne “D” -and $_.ServiceLevelCode -ne “KK” } | Sort-Object StartDate | select * -First 1
    $End = $warranties | Where-Object { ($_.EntitlementType -eq “Active” -or $_.EntitlementType -eq “Future”) -and $_.ServiceLevelCode -ne “D” -and $_.ServiceLevelCode -ne “KK” } | Sort-Object EndDate -Descending | select * -First 1
    $Provider = $Start.Provider
    $startDate = $Start.StartDate
    $endDate = $End.EndDate
    $daysLeft = ((Get-Date $End.enddate)-(Get-Date)).Days
    $description = $Start.ServiceLevelDescription
    }
    else {

    Reply

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