Using SCCM to Run the HP Battery Recall Utility

Using SCCM to Run the HP Battery Recall Utility

In January 2019, HP announced that they have extended the battery recall, which was announced in January of 2018. The batteries affected by this recall have the potential to overheat, posing a fire and burn hazard to HP customers.

HP highly recommends that customers check/recheck the device's battery even if the battery was previously checked and passed, or was informed that the battery was not affected.

How can the Battery be Checked?

Customers can check the status of the device battery by running the HP Battery Validation Utility.

What about for an enterprise environment with thousands of devices?

The following technique can be used to run the HP Battery Recall Utility Tool in an enterprise environment. This may help if you are trying to run the HP Battery Recall Utility in your enterprise environment with SCCM.

Setup, what you will need.

To begin you will need to create a network share that is accessible to everyone and reachable by the SCCM server. Depending on your network policies and compliance you may not be able to complete this, check with your network compliance team if you run into any issues.

You will need to download the fully loaded battery validation utility, create an SCCM application or package to install the utility on all HP laptops in your environment.

Results, how to obtain the results.

After the network, share is created and the utility is deployed through SCCM. Create another SCCM package with the below PowerShell script.

The Run-HPBRCU.ps1 script will remove any previously generated XML data and then silently run the installed HPBRCU and generate an XML file with the results.

The HPBRCU places the XML results in the following location, 'C:\Program Files (x86)\Hewlett-Packard\HP Battery Recall Utility'. The script then copies the XML results to the network share. You can then import the XML data into an Excel document to easily review the results.

The script can be found in the following repository, HPBRCU on Github.

    Purpose : Gather HP Battery Recall Utility results.
    Author  : James Wassinger
    Created : 4/19/2019

# Logging Function
function Write-LogEntry {
        [parameter(Mandatory=$true, HelpMessage="Value added to the log file.")]
        [parameter(Mandatory=$false, HelpMessage="Name of the log file that the  entry will written to.")]
        [string]$FileName = "HPBRCU_$(get-date -f yyyy-MM-dd).log"
    if(!(Test-Path -Path "C:\Windows\Temp")) {
        New-Item -Path "C:\Windows\Temp" -ItemType Directory -Force
    # Determine log file location
    $LogFilePath = Join-Path -Path $env:windir -ChildPath "Temp\$($FileName)"
    # Add value to log file
    try {
        Add-Content -Value "$(Get-Date)     $Value" -LiteralPath $LogFilePath  -ErrorAction Stop
    catch [System.Exception] {
        Write-Warning -Message "Unable to append log entry to $FileName file"

# Suppress default errors
$erroractionpreference = "SilentlyContinue"

# Assign variable for directory location of the running script.
$ROOT = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition

# Path of the install HP Battery Recall Utility on the computer.
$hpbrcu = "C:\Program Files (x86)\Hewlett-Packard\HP Battery Recall Utility"

# Enter the fileshare path where the results should be stored.

Write-LogEntry -Value "The HPBRCU script is starting on $env:COMPUTERNAME"

if((Test-Path -Path $hpbrcu)) {
    Write-LogEntry -Value "$hpbrcu, path found"
    #Remove any pre-existing XML files the utility may have generated.
    Remove-Item -Recurse -Path (Join-Path $hpbrcu -ChildPath *.xml) -Force

    <# Change to the utility directory. If you do not change to the directory
       and run the program the XML will not be generated. #>
    CD "C:\Program Files (x86)\Hewlett-Packard\HP Battery Recall Utility"

    <# Run the program after changing to the directory where the program resides.
       Switch -s or -o #>
    cmd /c "HPBRCU.exe" -s

    try {
    # Copy the generated output to the specified fileshare path.
    Copy-Item -Path ( Join-Path -Path $hpbrcu -ChildPath *.xml) -Destination  (Join-Path -Path $fileShare -ChildPath "$env:COMPUTERNAME.xml") -Force
    } catch {
        Write-LogEntry -Value "failed to copy item(s). $_"

        Output what the HP Battery Recall Utility is not installed,
        and exit the script.
    Write-LogEntry -Value "The HPBRCU is not installed on $env:COMPUTERNAME"

How to import the data to an Excel document.

  1. Open a new Excel document.
  2. If the developer tab is not visible you will need to enable the developer tab.
  3. To enable the developer tab
  4. Open Excel, and click on File
  5. Click on Options
  6. When the Excel Options Window opens click on Customize Ribbon on the left pane.
  7. In the Customize Ribbon section, you will notice a listing of the Main tabs. Add a checkmark to Developer to enable the tab.
  8. Click OK to save the changes.
  9. When you click on the Developer tab you will have access to all of the developer tools in Excel.
  10. Click on the Developer tab.
  11. Click on Import.
  12. Navigate to the FileShare where the XML data is stored.
  13. Select all files, and press Open
  14. The data will load into the Excel document.