Featured image of post Automating with PowerShell: Getting device warranty information

Automating with PowerShell: Getting device warranty information

Warranty reporting

This morning I woke up with a mission; I wanted to fix HP warranty reporting for my PSWarranty PowerShell Module. If you’re not familiar yet I’ve blogged about the module and warranty reporting before here. Most of the module has been left the same so you can reference that blog for more information.

Between that blog and now the PSWarranty module has had a lot of updates. Some vendors such as HP and Lenovo decided that selling warranties on devices isn’t something they are interested in and didn’t make their APIs public. Lenovo was easily solved by proxying the requests over an Azure Function I host. HP was more difficult.

Fortunately HP has a piece of software called HP Support Assistant, this tool does warranty checks for the device it’s running on so there must be an API for it right? Right. So I did what any smart hackity hacker would do and ran Fiddler on a device with HPSA. That was pretty short-lived - HPSA actually checks if Fiddler is running and my attempt was foiled by a smart developer. I decide to deep dive a little more.

HPSA is a UWP application, so accessing it is pretty annoying. First I gained access to the UWP app storage and copied over those files to another location. There I found the magic; a specific executable that actually did the warranty check requests. Jackpot! After a bit of looking I noticed the application was a .NET app so I open dotPeek and checked out what was in there. What I found was a complete mess of code; someone wanted to make it really difficult to figure this API out. I had to jump through a lot of hoops to get to the point where I found out which headers, files, and URLs were required.

All of this has been a great trip, and resulting in the new HP API proxy for PsWarranty! This means you can get data for all major manufacturers via PsWarranty now!

So how do I get started?!

Simple. Check out the github here or a blog about it here.

If you’re a vendor that wants to use the API proxies for Lenovo or HP, you can contact me at kelvin [at] cyberdrain.com.

and that’s it! As always, Happy PowerShelling

All blogs are posted under AGPL3.0 unless stated otherwise
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy