How to Remove HP Support Assistant with PowerShell

Keeping endpoints streamlined and free from unnecessary software is a critical responsibility for IT professionals and managed service providers (MSPs). Bloatware, especially pre-installed OEM utilities like HP Support Assistant, can present complications ranging from system instability to unwanted background processes. For administrators aiming to maintain tight control over their managed environments, automating the removal of such software is both practical and necessary. This post details how to remove HP Support Assistant with PowerShell—a robust and repeatable method for IT pros managing large fleets of HP devices.

Background

HP Support Assistant is bundled with many HP consumer and business-class systems. While intended to simplify driver updates and diagnostics, it often proves redundant for IT teams that already rely on centralized management tools. It also introduces unnecessary services, scheduled tasks, and user interface popups—making it a common candidate for removal in professional environments.

Unfortunately, HP does not always provide a clean or consistent way to uninstall this utility manually, especially across different system configurations. This PowerShell script automates and standardizes the uninstallation process, including removing registry entries and Microsoft Store versions if present.

The Script

#Requires -Version 5.1

<#
.SYNOPSIS
    Removes the HP Support Assistant.
.DESCRIPTION
    Removes the HP Support Assistant from the system.
By using this script, you indicate your acceptance of the following legal terms as well as our Terms of Use at https://www.ninjaone.com/terms-of-use.
    Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms. 
    Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party. 
    Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library or website belonging to or under the control of any other software provider. 
    Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations. 
    Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks. 
    Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script. 
    EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).
.EXAMPLE
    (No Parameters)
    
    [Info] HP Support Assistant is installed.
    [Info] HP Support Assistant is not installed from Microsoft Store.
    [Info] Removing HP Support Assistant from the registry.
    [Info] Removing HP Support Assistant.
    [Info] Successfully removed HP Support Assistant.

.OUTPUTS
    None
.NOTES
    Minimum OS Architecture Supported: Windows 10, Windows Server 2016
    Release Notes: Initial Release
#>

[CmdletBinding()]
param ()

begin {
    function Test-IsElevated {
        $id = [System.Security.Principal.WindowsIdentity]::GetCurrent()
        $p = New-Object System.Security.Principal.WindowsPrincipal($id)
        $p.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)
    }
    $ProgramFiles32bit = if ((Test-Path -Path ${env:ProgramFiles(x86)} -ErrorAction SilentlyContinue)) {
        # 64-bit OS uses ProgramFiles(x86) environment variable.
        ${env:ProgramFiles(x86)}
    }
    elseif ((Test-Path -Path ${env:ProgramFiles} -ErrorAction SilentlyContinue)) {
        # 32-bit OS uses ProgramFiles environment variable.
        $env:ProgramFiles
    }
    else {
        # Program Files directory was not found.
        Write-Host "[Error] Failed to find Program Files directory."
        exit 1
    }
}
process {
    if (-not (Test-IsElevated)) {
        Write-Error -Message "Access Denied. Please run with Administrator privileges."
        exit 1
    }

    # Check if the HPSupportAssistant.dll file exists
    # "C:\Program Files (x86)" is the only location where HP Support Assistant is installed on 64-bit Windows.
    if ($(Test-Path -Path "$ProgramFiles32bit\HP\HP Support Framework\HPSupportAssistant.dll")) {
        Write-Host "[Info] HP Support Assistant is installed."
    }
    else {
        Write-Host "[Error] HP Support Assistant is not installed."
        exit 1
    }

    # Remove HP Support Assistant from Microsoft Store
    $AppxPackages = Get-AppxPackage -AllUsers | Format-List -Property PackageFullName, PackageUserInformation | Where-Object { $_.PackageFullName -like "*hpsupportassistant*" }
    if ($AppxPackages) {
        Write-Host "[Info] Removing HP Support Assistant from Microsoft Store."
        try {
            $AppxPackages | ForEach-Object {
                Remove-AppxPackage -Online -PackageFullName $_.PackageFullName -AllUsers
            }
            Write-Host "Successfully removed HP Support Assistant from Microsoft Store."
        }
        catch {
            Write-Host "[Error] $($_.Exception.Message)"
            Write-Host "[Error] Failed to remove HP Support Assistant from Microsoft Store."
        }
    }
    else {
        Write-Host "[Info] HP Support Assistant is not installed from Microsoft Store."
    }

    try {
        $ProcessSplat32bit = @{
            FilePath     = "$ProgramFiles32bit\HP\HP Support Framework\UninstallHPSA.exe"
            ArgumentList = "/s /v/qn UninstallKeepPreferences=FALSE"
            Wait         = $true
            WindowStyle  = "Hidden"
        }
        if ($(Test-Path -Path $ProcessSplat32bit.FilePath -ErrorAction SilentlyContinue)) {
            try {
                Write-Host "[Info] Removing HP Support Assistant from the registry."
                Remove-Item -Path "Registry::HKEY_LOCAL_MACHINE\Software\WOW6432Node\HP\HPActiveSupport" -Recurse -Force -ErrorAction Stop
            }
            catch {
                Write-Host "$($_.Exception.Message)"
                Write-Host "[Error] Failed to remove registry key: Registry::HKEY_LOCAL_MACHINE\Software\WOW6432Node\HP\HPActiveSupport"
                exit 1
            }
            try {
                Write-Host "[Info] Removing HP Support Assistant."
                Start-Process @ProcessSplat32bit -ErrorAction Stop
                Write-Host "[Info] Successfully removed HP Support Assistant."
            }
            catch {
                Write-Host "$($_.Exception.Message)"
                Write-Host "[Error] Failed to remove HP Support Assistant."
                exit 1
            }
            # Find and stop HP Support Assistant processes
            Write-Host "[Info] Attempting to stop HP Support Assistant processes."
            $Process = Get-CimInstance -ClassName Win32_Process -ErrorAction SilentlyContinue | Where-Object { $_.CommandLine -like "*HPSupportAssistant*" }
            if ($Process) {
                $Process | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }
                Write-Output "[Info] HP Support Assistant process has been stopped."
            }
            else {
                Write-Output "[Warn] HP Support Assistant process not found."
            }
        }
        else {
            Write-Host "[Warn] UninstallHPSA.exe is missing. Skipping."
        }
    }
    catch {
        Write-Host "$($_.Exception.Message)"
        Write-Host "[Error] Failed to remove HP Support Assistant."
        exit 1
    }
}

end {
    
    
    
}

 

Detailed Breakdown

The script follows a comprehensive sequence to detect and remove HP Support Assistant. Here’s a step-by-step breakdown:

  1. Environment and Permissions Check
    • The script starts by verifying that it’s being run with administrative privileges. If not, it halts execution with an access error.
    • It dynamically identifies the appropriate Program Files (x86) path, accounting for both 32-bit and 64-bit systems.
  2. Presence Check
    • It searches for the HPSupportAssistant.dll file in the standard HP Support Framework directory to confirm if the utility is installed.
  3. Microsoft Store Removal
    • If the utility was installed via the Microsoft Store, the script uses Get-AppxPackage to find and remove it for all users using Remove-AppxPackage.
  4. Registry Cleanup
    • It removes the related registry key under HKLM\Software\WOW6432Node\HP\HPActiveSupport to eliminate traces and configuration remnants.
  5. Silent Uninstall
    • The script invokes UninstallHPSA.exe with silent flags to remove the software without user interaction or prompts. This step ensures the process runs quietly in the background—ideal for scripting.
  6. Process Termination
    • To ensure full cleanup, it checks for lingering processes related to HP Support Assistant and forcefully stops them if detected.

This thorough approach ensures that HP Support Assistant is not only uninstalled but also cleaned up entirely—registry entries, store packages, and running processes included.

Potential Use Cases

Imagine a managed service provider onboarding 150 HP laptops for a new client. Part of their endpoint hardening checklist involves removing unnecessary vendor utilities. Instead of manual uninstallation, which could take days and introduce inconsistencies, the MSP integrates this PowerShell script into a NinjaOne automation policy. Within minutes, all machines are audited and cleared of HP Support Assistant—automatically and silently. This saves time, improves system performance, and aligns with security best practices.

Comparisons

Other removal methods include:

  • Manual Uninstall via Control Panel or Settings: Time-consuming and inconsistent across devices.
  • Third-party uninstallers like Revo or PDQ: Often require licensing and additional configuration.
  • Microsoft Intune Scripts: Work well in Microsoft-centric environments but lack platform flexibility.

Compared to these, using PowerShell directly is faster, scriptable, and easier to integrate into broader IT workflows—especially through RMM tools like NinjaOne.

FAQs

Q: Will this script remove all traces of HP Support Assistant?

Yes. It removes the program files, registry keys, Microsoft Store packages, and running processes.

Q: Is this safe to run on all Windows versions?

The script is intended for Windows 10 and Windows Server 2016 or newer. Testing on a subset of devices is recommended before mass deployment.

Q: Does the script require user interaction?

No. It performs a silent uninstall using command-line flags and built-in error handling.

Q: What if UninstallHPSA.exe is missing?

The script detects its presence and logs a warning if the file is not found, avoiding a script crash.

Q: Can this script be used in NinjaOne policies?

Absolutely. It’s ideal for deployment through automation engines like NinjaOne.

Implications

Leaving HP Support Assistant installed on enterprise machines can lead to:

  • Unwanted software updates interfering with IT patching cycles.
  • Popups disrupting users during work.
  • Potential vulnerabilities if the tool becomes outdated and unsupported.

By removing it systematically with PowerShell, organizations can improve endpoint security, reduce user distractions, and maintain tighter control over installed software.

Recommendations

  • Run as Administrator: Always execute this script with elevated privileges.
  • Test in Sandbox: Run on a test machine before deploying organization-wide.
  • Use with RMM: Tools like NinjaOne, SCCM, or Intune can automate deployment.
  • Document Changes: Log removal actions for audit compliance.
  • Monitor Results: Check event logs or NinjaOne policy reports for execution outcomes.

Final Thoughts

Automating software removal is essential for modern IT operations. This PowerShell script offers a clean, repeatable way to remove HP Support Assistant using PowerShell, saving valuable time and reducing system clutter. For MSPs and IT departments looking to scale this operation, NinjaOne provides the ideal platform—allowing you to deploy scripts, verify results, and maintain compliance across all managed devices. From software removal to full-stack endpoint automation, NinjaOne helps ensure your IT workflows are secure, efficient, and scalable.

By leveraging scripts like this within NinjaOne’s automation framework, IT professionals can focus more on strategy and less on repetitive, manual tasks.

Next Steps

Building an efficient and effective IT team requires a centralized solution that acts as your core service delivery tool. NinjaOne enables IT teams to monitor, manage, secure, and support all their devices, wherever they are, without the need for complex on-premises infrastructure.

Learn more about NinjaOne Remote Script Deployment, check out a live tour, or start your free trial of the NinjaOne platform.

Categories:

You might also like

×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).