Sysadminsblog.com Anything for sysadmins!

12Aug/146

Dell warranty information API

I’ve always used the SOAP API that’s provided by Dell, however recently it stopped working due to a misconfiguration in the service. This triggered me to find a different solution and luckily Dell also provides a REST API that is even simpler, gives more detailed information and actually still works.

There are 3 APIs available at the moment, but I will only dig into the warranty status as that is the most useful.

Functional specification of the warranty status API: http://en.community.dell.com/dell-groups/supportapisgroup/m/mediagallery/20438177/download.aspx

Function Global:Get-DellAssetInformation {
    Param([String]$ServiceTag = $(Get-WmiObject -Class "Win32_Bios").SerialNumber)
    Try {
        # Possible API keys
        # 1adecee8a60444738f280aad1cd87d0e
        # d676cf6e1e0ceb8fd14e8cb69acd812d
        # 849e027f476027a394edd656eaef4842
        $APIKey = "1adecee8a60444738f280aad1cd87d0e"
        $DellURL = "https://api.dell.com/support/v2/assetinfo/warranty/tags.xml?svctags=$ServiceTag&apikey=$APIKey"

        $XML = New-Object System.Xml.XmlDocument
        $XML.Load($DellURL)
        $XML.GetAssetWarrantyResponse.GetAssetWarrantyResult.Response.DellAsset
        $XML.GetAssetWarrantyResponse.GetAssetWarrantyResult.Response.DellAsset.Warranties.Warranty
    }
    Catch {
        Write-Host $($_.Exception.Message)
    }
}

Once you run this bit of code you can use the following to get the detailed information.

To get the information for the local machine use:

Get-DellAssetInformation

To get the information for a different ServiceTag use the following:

Get-DellAssetInformation -ServiceTag AB12AB1

If you have questions or comments, please post it below!

More information: http://en.community.dell.com/dell-groups/supportapisgroup/

Be Sociable, Share!

Posted by Mischa Oudhof

Comments (6) Trackbacks (0)
  1. There is a mistype on $DellURL variable.
    it should be
    $DellURL = “https://api.dell.com/support/v2/assetinfo/warranty/tags.xmlsvctags=${ServiceTag}&apikey=${APIKey}”

    Eitherway great script, job well done!

  2. how can i get the APIKey?

  3. Is there a limit to the queries per minute? I plan to pull data off of computers from Active Directory using an adaptation of this.


Leave a comment

No trackbacks yet.