Laptop battery health status Joshua Campbell June 11, 2020 16:56 Share Is there a way in PDQ to retrieve whether a laptop's battery is good or not? Thanks in advance. 1
You could probably do a WMI query for the Win32_Battery class. See this Microsoft doc for more info:
Of course, you'd have to set up a new WMI or PowerShell scanner in order to harvest the data.
I tried that on a laptop with a good battery and on one with a bad battery. On both the "Status" came back as OK and the BatteryStatus came back as 2 (that is, "unknown" per https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-battery). But, I guess now I wonder whether the battery information is actually accurate when powered by AC. And if that is the case, then it is going to get a little harder to make sure users' laptops have healthy batteries.
Have you tried this PowerShell Scanner? https://github.com/pdq/PowerShell-Scanners/tree/master/PowerShell%20Scanners/Battery%20Status
Hi Colby. No sir, I cannot say that I have tried that. Would it help me accurately determine if the battery is unhealthy?
And, I just realized that I did not define what I meant by "unhealthy". I am trying to find if a battery will no longer last more than say 60 minutes after a full charge and therefore needs to be scheduled for replacement.
It calculates Health as full charge divided by designed capacity, so it might be close. https://github.com/pdq/PowerShell-Scanners/blob/master/PowerShell%20Scanners/Battery%20Status/Battery%20Status.ps1
OK, I'll take a look at it and see what I can do. I've never used one of your scanners. Do I just save the script and then add that to a Scan Profile in PDQ Inventory?
That'll work, but the best way is outlined in the main README: https://github.com/pdq/PowerShell-Scanners/blob/master/README.md
Thank you Colby.
I imported the scan profile and executed it against a laptop that I recently replaced the battery (known good), a laptop that I need to replace the battery (known bad) and then a random laptop. The results look very promising and I think that I can use this as a metric to try to predict when we might need to make sure we have a replacement battery on hand.
I really like this software. Was playing around with this scanner, and figured out how to configure the trigger so it will update when data is more than three days old, and only link it to the laptop OU from AD so it's not trying to run on all our desktops and servers. Just when you think you're starting to learn the ins and outs, you discover a new layer of usefulness.
Hi, I just signed in to say how brilliant the script is - thanks so much.
I had a user contact me recently saying his laptop doesn't last very long when running on battery, so I ran a health report - it was less than 5% capacity! I wondered how many other laptops were in this state, so began to look up how I could use powershell to extract this info - it looked daunting.
... so I add "PDQ" to my googling, and what do you know, PDQ are one step ahead. Awesome work Colby.
How are you managing the data within PDQ Inventory via Collections to properly review the results? I can see the scanner is clearly working but the visibility is limited to reviewing (Single) machines at a time.
Is there some info on creating a dynamic collection w/the provided data to review healthy vs non healthy machines?
Edit: I created a collection (Battery Health), based on scanner. Then added sub-category for < 25%, <50% etc using the;
PowerShell (Battery Status) Name Contains Dell
PowerShell (Battery Status) Health Less Than (Value)
You can view the data using a report or group computers based on the data using a dynamic collection. For either use case you would use the "PowerShell (Battery Status)" table (assuming you use the scanner names defined in the .xml scan profile in the github repo) and then choose whichever parameters you want to filter on, e.g: Health greater than 75
Please sign in to leave a comment.