Uninstalling the HP Insights Windows Agent with SCCM or Microsoft Intune

Prev Next

Introduction

If the HP Insights for Windows application is installed using Microsoft System Center Configuration Manager (SCCM), these instructions are based on version 2203. Steps may vary slightly for other SCCM versions.

This guide outlines the steps to uninstall the HP Insights Windows Application from devices, focusing on Microsoft SCCM v.2203 or Intune environments.

Prerequisites

  1. Download the Uninstallation PowerShell script from here.

  2. Extract the uninstall script and keep it as [Local-Folder-Path1].

  3. Ensure deployment is removed (Target Installation) for an existing application for the HP Insights for Windows Application created in Intune or SCCM.

  4. We are creating new application in Intune or SCCM to detect the presence HP Insights application and automatically uninstall it. Consider this as new deployment (Installation Activity).

Intune

Preparation Steps:

  1. To convert the uninstallation script into Intunewin format, download the Win32 Content Prep Tool from: https://github.com/Microsoft/Microsoft-Win32-Content-Prep-Tool

  2. Save the IntuneWinAppUtil.exe to a [Download-Folder-Path].

  3. Open an Admin command prompt and go to [Download-Folder-Path] using cd command and run the following command to convert the uninstall script to Intunewin format.

    1. Replace [Local-Folder-Path1] with the local folder where the uninstall script is extracted. IntuneWinAppUtil.exe -c [Local-Folder-Path1] -s HPInsights-Uninstall-Script.ps1 -o [Local-Output-Folder-Path]. For example: IntuneWinAppUtil.exe -c “C:\UninstallScript\” -s hp-insights-uninstall-script.ps1 -o “C:\IntuneFiles\”

    Ensure that the UninstallScript and IntuneFiles are folder created at C Drive and UninstallScript folder contains HPInsights-Uninstall-Script.ps1 file before running above command.

  4. After the files are successfully converted, the following Intunewin files will be present: hp-insights-uninstall-scriptHPInsights-Uninstall-Script.intunewin

Creating an Application in Intune

To create a new Intune application package to uninstall HP Insights Windows Application:

  1. Log into the Azure portal. The Home page is displayed.

  2. Go to Microsoft Intune Admin Center and click Apps > Platforms > Windows.

  3. Click Create and select App type as “Windows app (Win32)” and then click Select.

  4. Click Select app package file.

  5. Select the converted Intunewin file hp-insights-uninstall-script.intunewin

  6. Click OK.

  7. In the App information page, enter the following detail and then click Next.

    1. Name: Uninstallation for HP Insights Windows Application

    2. Publisher: HP Inc.

    3. Version: 1.X.X.X (replace with HPInsights-Uninstall-Script.ps1 version mentioned inside the script)

  8. In the Program page, in Install command, enter powershell.exe -ExecutionPolicy Bypass -File .\hp-insights-uninstall-script.ps1

  9. Enter the Uninstall command as None.

  10. Click Review + save.

  11. In the Requirements tab:

    1. In Check operating system architecture:

      1. Select Yes. Specify the systems the app can be installed on

      2. Select Install on x64 system.

      3. Install on ARM64 system

        Note: Select this option only if the target devices are on ARM platform.

    2. Select Minimum operating system as per target environment. For example: Windows 10 1607

  12. Click Review + save.

  13. In the Detection rules tab, select Rules format as “Use a custom detection script.”

    1. Save the contents below in HpInsights-Detection-Script.ps1 file on local device and select this as Script file

$service = Get-Service -Name "hpLHAgent" -ErrorAction SilentlyContinue
if ($null -eq $service) {
exit 1
}
exit 0
  1. Click on Review + save.

  2. In the Review + save tab, click Save.

Deploying an Application in Intune:

  1. In the Assignments section, click the edit option.

  2. In the Assignments tabs, go the Required sections and select Add group, Add all users, or Add all devices based on the deployment strategy and target.

  3. For Silent Installation, click Show all toast notifications within End user notifications section.

  4. In the End user notifications, select Hide all toast notifications and click OK.

  5. Click Review + save.

  6. In the Review + save tab, click Save.

SCCM

Prerequisites

Ensure the uninstall script HPInsights-Uninstall-Script.ps1is copied at UNC Path at SCCM Server system.

Creating an Application in SCCM

  1. Log in to the SCCM Admin Console and start the Create Application wizard.

  2. In the SCCM Admin Console, click Software Library.

  3. In the Software Library workspace, click Application Management > Applications > Create Application.

  4. Select the option - Manually specify the application information.

  5. Click Next.

  6. Enter the following details and click Next:

    1. Name: Uninstallation for HP Insights Windows Application

    2. Publisher: HP Inc.

    3. Version: 1.X.X.X (replace with hp-insights-uninstall-script.ps1 version mentioned inside the script).

  7. Click Next to accept the defaults for the Application Catalog entry.

  8. Click Next.

  9. Click Add to create a new Deployment Type and select type as “Script Installer.”

  10. Manually specify the deployment type information, which is selected automatically.

  11. Click Next.

  12. For the Deployment Type, enter the name as “Removal of HP Insights application - silent install.”

  13. Click Next.

  14. In the Content Location, specify the Network path (UNC name) to the hp-insights-uninstall-script.ps1 file. For example: \\WIN-Server-PC\Softwares\HP\Uninstall\

  15. In the Installation Program, specify the command as None

  16. In the Uninstallation program, specify powershell.exe -executionpolicy bypass -WindowStyle Hidden -noninteractive -nologo -file "hp-insights-uninstall-script.ps1"

  17. Select the option Run installation and uninstall program as 32-bit process on 64-bit clients.

  18. Click Next.

  19. Select Use a custom script to detect the presence of this deployment type.

  20. Click Edit.

  21. For Script type, select the dropdown as “Powershell.”

  22. Provide the following script contents:

    $service = Get-Service -Name "hpLHAgent" -ErrorAction SilentlyContinue
    if ($null -eq $service) {
    exit 1
    }
    exit 0

  23. Click OK; then click Next.

  24. For Installation behavior, select “Install for system.”

  25. For Log on requirement, select “Whether or not a user is logged.”

  26. Click Next until the close button is displayed. Then, click Close.

Deploying an Application in SCCM:

  1. Log in to the SCCM Admin Console and click Software Library.

  2. In the Software Library workspace, right click on Uninstallation for HP Insights Windows Application and click Deploy.

  3. On Collection, click Browse…:

  4. Click User Collections or Device Collections as per deployment strategy and select the target devices and user for uninstallation.

  5. Click OK and then Next.

  6. Ensure Distribution point is shown in window.

  7. Click Next.

  8. In Deployment Setting, select Action as “Uninstall.”

  9. Click Next and then Next.

  10. In User Experience setting, select the dropdown for Hide in Software Center and all notifications as “User Notifications: setting”.

  11. Click Next until Close button is displayed, then click Close.

General Note for Uninstalling HP Insights application using Intune or SCCM

Important: If the customer or IT Administrator is enforcing strict PowerShell execution policies (such as AllSigned, RemoteSigned, or other restricted execution policies), the provided uninstall PowerShell script hp-insights-uninstall-script.ps1 must be digitally signed before deployment. In such environments:

  • The IT Administrator must sign the provided PowerShell uninstall script with an approved code-signing certificate.The signed script must be used when configuring the application deployment in Intune or SCCM.

  • The IT Administrator must ensure that the corresponding code-signing certificate (or its issuing CA certificate) is present in the Trusted Root Certification Authorities or Trusted Publishers store under the Local Computer certificate store on all target devices.

  • Failure to meet these requirements may result in the uninstall script being blocked by the system execution policy.

Contact Us

For any assistance, create a support case or email `support@wxp.hp.com`.