Remote work / Hybrid work is a new normal since pandemic and therefore notebooks being utilized as dedicated desktops requires a focus on battery management to increase the device’s battery life and thus maximizing user uptime. A continuously charged battery and incorrect battery management settings can lead to conditions of mechanical failure and can accelerate the degradation of the expected battery life.
In this article, I will walk you through how to: Deploy the script to set the proper BHM settings across the fleet based on HP’s recommendation.
HP Battery Health Manager Recommendation
A new BIOS-level setting, HP Battery Health Manager (BHM), was implemented in 2020. HP BHM is designed to help mitigate the exposure of the notebook battery to key factors that can accelerate battery degradation and swelling over time. HP recommends that customers update their BIOS to include the latest version of HP BHM and enable HP BHM to one of the two options below based on usage environment and or the age of the notebook:
- Set devices with batteries manufactured in 2020 and later to Let HP manage my battery charging.
- Set devices with batteries manufactured before 2020 to Maximize my battery health.
For more information about HP BHM and the two options, see:
- HP Introduces HP Battery Health Manager to Help Optimize Battery Health
- Using HP Battery Health Manager
For the Maximize my battery health setting:
- There is a one-time recommendation that the end-users unplug the device for up to 2 hours to discharge the battery to about 75%, and then they can choose to leave the device plugged into the power source.
- The battery icon in Windows will show 80% as per design. We recommend that you notify the end-users of this expected behavior to avoid any confusion.
- Ensure that the HP Windows 10 Notebook devices have the BIOS version supporting BHM. [You can refer to my Previous Article to prepare for BIOS Update]
- Download the remediation PowerShell Script files that will be used to set the BHM settings.
- Access to an Endpoint Management tool to deploy the PowerShell scripts.
Download the remediation PowerShell script files to set the BHM settings.
- HP-ConfigureBHMSettings.ps1 – script to update the Battery Health Manager (BHM) Setting based on the battery manufactured year.
- Script and supporting files to generate a secure BIOS Setup Password file and corresponding AES encryption key – for customers who have set a unified BIOS Setup password across their fleet.
- The script will only run on HP manufactured devices and excludes virtual machines.
- You must run the script with Administrative privileges.
- Download the HP Client Management Script Library installer from https://www.hp.com/us-en/solutions/client-management-solutions/download.html and include the executable with the script.
- Ensure that .ps1 and .exe files are in the same folder.
- Logs are output to “C:\ProgramData\HP\CMSL\<computername>_BHM.log” .
- Devices with batteries manufactured >= 2020 will be updated to “Let HP manage my battery charging.”
- Devices with batteries manufactured <= 2019 will be updated to “Maximize my battery health.”
- A registry key HKLM:\SOFTWARE\HP\HPDeviceManagement\CMSL\BHM will be created and will record the BHM setting configured by the script.
- A reboot is not required after the script runs; the BHM setting will take effect immediately.
Standard Exit Codes
See below table for the Standard Exit Codes Output by the PowerShell Script:
|0||There is no error|
|8||Non-HP manufactured PC|
|27||OS version not supported|
|64||CMSL installer not found|
|65||CMSL install failure|
|216||BIOS password incorrect|
|217||BIOS download failure|
Deploying the Script to Set the Recommended BHM Settings
Some examples of Endpoint Management tools you can use to deploy the script are Microsoft System Center Configuration Manager, Microsoft Endpoint Manager, VMware Workspace ONE, Tanium, DesktopCentral, Altiris etc. In the Endpoint Management tool of your choice, create a device group for the targeted devices regardless if the BHM settings are set as per HP recommendation or not and target the script to those devices. In production, the script runs silently, but for purposes of this article, we are showing the output of the script when run in a command prompt. The script applies the BHM settings automatically, and you can run it periodically to enforce the BHM settings within the fleet.
Generating the Secure BIOS Password File and Encryption Key
If you have set a unified BIOS Setup password across your fleet, run the included “Generate_SecurePassword.ps1” script to generate a secure password file and AES encryption key. This approach assumes that all devices share the same BIOS password.
- Enter the BIOS Setup password in the “Generate_SecurePassword.ps1” file. In this example, the password is “P@ssword1”
- Enter the same BIOS Setup password in the “Password.txt” and save the file.
- Run “Generate_SecurePassword.ps1” to generate a secure password.txt file and AES.key encryption key.
- Include both the “Password.txt” file and “AES.key” files along with the “HP-ConfigureBHMSettings.ps1” script & the “CMSL installer” when creating a Package and deploying to your fleet.
HP offers Proactive Insights powered by HP TechPulse, a powerful telemetry and analytics platform that provides all the actionable insights for the enrolled devices through a single, simple to use dashboard (SaaS application).
Using HP TechPulse dashboard, you can (among many other things)…
- Identify devices in your fleet with BIOS versions which do not meet the minimum required version for BHM.
- Identify BIOSs that have the incorrect BHM settings according to the HP Service Advisory.
- Monitor the BHM setting changes using an Excel report extracted from HP TechPulse.
- Monitor the BHM setting changes using the Dashboard widget.
One Time Battery Replacement Service
- Detailed CMSL syntax available here
- HP CMSL Installer is available to download from HP Download Library
Please ensure you perform adequate testing before rolling out the script to your fleet.
* Please feel free to reach out with any comments or questions!