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

Recent Articles

The return of CyberDrain CTF

CyberDrain CTF returns! (and so do I!)

It’s been since september that I actually picked up a digital pen equivalent and wrote anything down. This was due to me being busy with life but also my side projects like CIPP. I’m trying to get back into the game of scripting and blogging about these scripts. There’s still so much to automate and so little time, right? ;)

Monitoring with PowerShell: Monitoring Acronis Backups

Intro

This is a monitoring script requested via Reddit, One of the reddit r/msp users wondered how they can monitor Acronis a little bit easier. I jumped on this because it happened pretty much at the same time that I was asked to speak at the Acronis CyberSummit so it kinda made sense to script this so I have something to demonstrate at my session there.

Monitoring with PowerShell: Monitoring VSS Snapshots

Intro

Wow! It’s been a while since I’ve blogged. I’ve just been so swamped with CIPP that I’ve just let the blogging go entirely. It’s a shame because I think out of all my hobbies it’s one I enjoy the most. It’s always nice helping others achieve their scripting target. I even got a couple of LinkedIn questions asking if I was done with blogging but I’m not. Writing always gives me some more piece of mind so I’ll try to catch up again. I know I’ve said that before but this time I’ll follow through. I’m sitting down right now and scheduling the release of 5 blogs in one go. No more whining and no more waiting.