Automatically Retrieve Dell Warranty Info and Import it into PDQ Inventory Custom Fields
One of my coworkers was tasked with pulling reports of old computers that need to be replaced which sent me down a rabbit hole of trying to automatically determine that based on data in PDQ Inventory. I couldn't find a great solution so I decided to automate importing some data into PDQ to make this work.
Here is the link to the GitHub repo: https://github.com/jlukenichols/KUDellWarrantyChecker
Basically, it does this:
- The script looks at a CSV file containing every Dell computer in your PDQ Inventory. It must have the Computer Name and Computer Serial Number fields, but it can contain additional fields as well if you want. I have this on an auto-report which saves the CSV file to a UNC path on a network share every night at 6:00 PM. If you do an auto report make sure to NOT include the date in the file path and make sure to overwrite old files. I have the filters on the report set to this:
- The script iterates through each service tag in the CSV file, performs a Dell API lookup to grab its warranty data, and saves that data into an output CSV file. Right now the data grabbed is "Ship Date" and the device's entitlement (warranty) end dates. Because a computer can have several entitlements it just grabs the maximum of all the dates returned. Some of my devices had a 1-year initial entitlement and a 3-year extended entitlement so I just wanted to know when all of its warranties would be expired.
- The script imports the Dell warranty data from the newly created CSV file and imports it into PDQ Inventory as custom fields. It assumes that you have already created the custom fields with date/time data types. If you want to mirror my setup then create the custom fields like this:
This code is available for anyone to use, although you will need to apply for your own Dell API key on Dell TechDirect: https://techdirect.dell.com/Portal/APIs.aspx
If you run into issues getting your API key you should email APIs_TechDirect@dell.com. I know my request to gain access to the API portal was denied several times with an utterly useless error code being emailed to me, and the issue turned out to be that I had no Dell service tags or Dell customer number associated with my account. I ended up reaching out to them via email and just giving them some of our Dell service tags with which they were able to look up my Dell customer number and associate it to my account. After that I got into the API program without issues.
If anyone has any questions about the script or needs help setting it up for their environment let me know.