The sample scripts are not supported under any N-able support program or service. The sample scripts are provided AS IS without warranty of any kind, and N-able expressly disclaims all implied warranties including, warranties of merchantability or of fitness for a particular purpose. In no event shall N-able or any other party be liable for damages arising out of the use of or inability to use the sample scripts.

Battery Capacity Monitoring NC

Last Modified Date

6/22/2021 2:16 PM

Description

This script was taken from a Reddit Post and modified to work within N-Central 2021.1+

The script gets battery information for all batteries (usually for most laptops there should be only one), and will compare the reported full charged capacity (in milli-watt-hours) and will compare it to the designed capacity. it will generate a percentage from it and will report on the ''health'' of the battery based on that.

If multiple batteries are found, it will show details for all of them but will only threshold on the worse one.

Type

Custom Service / Script Check

Category

Windows Devices

Target OS

Windows 8/8.1;Windows 10;Windows Server 2012 / 2012R2;Windows Server 2016;Windows Server 2019

Compatible with N-Central

Yes

N-Central minimum version

2021.1

Compatible with RMM

No

Syntax

To use this, simply upload the policy to your N-central server. 
Once uploaded, create a custom service and pick this automation policy. 
In the thresholds, we recommend putting 0-60 as failed, 60-70 as warning, and 70-100 as normal. 
the other items should not have thresholds.

Output

The Policy will output the following data points :

Policy Output Parameters:
     Battery Serial Number: bq20z45109PJ35CAV847DZACACDANA
     Calculated Battery Capacity Left %: 82
     Designed Capacity (milliwatt-hours): 73360
     Full Capacity (milliwatt-hours): 60440
     Number of Batteries Found on This System: 1
     Details About All Batteries Found: bq20z45109PJ35CAV847DZACACDANA , Capacity%: 82 , DesignedCapacity: 73360 , FullCharge: 60440


if multiple batteries are found, the last output ("details") will output the info for all batteries, however the worse one will be shown above so it can be thresholded against

Keywords

Related Content