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
Download the Uninstallation PowerShell script from here.
Extract the uninstall script and keep it as Local-Folder-Path1.
Ensure deployment is removed (Target Installation) for an existing application for the HP Insights for Windows Application created in Intune or SCCM.
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:
To convert the uninstallation script into Intunewin format, download the Win32 Content Prep Tool from:
https://github.com/Microsoft/Microsoft-Win32-Content-Prep-ToolSave the IntuneWinAppUtil.exe to a [Download-Folder-Path].
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.
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\”Note: 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.
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:
Log into the Azure portal. The Home page is displayed.
Go to Microsoft Intune Admin Center and click Apps > Platforms > Windows.
Click Create and select App type as “Windows app (Win32)” and then click Select.
Click Select app package file.
Select the converted Intunewin file
hp-insights-uninstall-script.intunewinClick OK.
In the App information page, enter the following detail and then click Next.
Name: Uninstallation for HP Insights Windows Application
Publisher: HP Inc.
Version: 1.X.X.X (replace with HPInsights-Uninstall-Script.ps1 version mentioned inside the script)
In the Program page, in Install command, enter
powershell.exe -ExecutionPolicy Bypass -File .\hp-insights-uninstall-script.ps1Enter the Uninstall command as None.
Click Review + save.
In the Requirements tab:
In Check operating system architecture:
Select Yes. Specify the systems the app can be installed on
Select Install on x64 system.
Install on Arm64 system
Note: Select this option only if the target devices are on Arm platform.
Select Minimum operating system as per target environment. For example: Windows 10 1607
Click Review + save.
In the Detection rules tab, select Rules format as “Use a custom detection script.”
Save the contents below in
HpInsights-Detection-Script.ps1file on local device and select this as Script file
$service = Get-Service -Name "hpLHAgent" -ErrorAction SilentlyContinue
if ($null -eq $service) {
exit 1
}
exit 0Click on Review + save.
In the Review + save tab, click Save.
Deploying an Application in Intune:
In the Assignments section, click the edit option.
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.
For Silent Installation, click Show all toast notifications within End user notifications section.
In the End user notifications, select Hide all toast notifications and click OK.
Click Review + save.
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
Log in to the SCCM Admin Console and start the Create Application wizard.
In the SCCM Admin Console, click Software Library.
In the Software Library workspace, click Application Management > Applications > Create Application.
Select the option - Manually specify the application information.
Click Next.
Enter the following details and click Next:
Name: Uninstallation for HP Insights Windows Application
Publisher: HP Inc.
Version: 1.X.X.X (replace with hp-insights-uninstall-script.ps1 version mentioned inside the script).
Click Next to accept the defaults for the Application Catalog entry.
Click Next.
Click Add to create a new Deployment Type and select type as “Script Installer.”
Manually specify the deployment type information, which is selected automatically.
Click Next.
For the Deployment Type, enter the name as “Removal of HP Insights application - silent install.”
Click Next.
In the Content Location, specify the Network path (UNC name) to the
hp-insights-uninstall-script.ps1file. For example:\\WIN-Server-PC\Softwares\HP\Uninstall\In the Installation Program, specify the command as None
In the Uninstallation program, specify
powershell.exe -executionpolicy bypass -WindowStyle Hidden -noninteractive -nologo -file "hp-insights-uninstall-script.ps1"Select the option Run installation and uninstall program as 32-bit process on 64-bit clients.
Click Next.
Select Use a custom script to detect the presence of this deployment type.
Click Edit.
For Script type, select the dropdown as “Powershell.”
Provide the following script contents:
$service = Get-Service -Name "hpLHAgent" -ErrorAction SilentlyContinue if ($null -eq $service) { exit 1 } exit 0Click OK; then click Next.
For Installation behavior, select “Install for system.”
For Log on requirement, select “Whether or not a user is logged.”
Click Next until the close button is displayed. Then, click Close.
Deploying an Application in SCCM:
Log in to the SCCM Admin Console and click Software Library.
In the Software Library workspace, right click on Uninstallation for HP Insights Windows Application and click Deploy.
On Collection, click Browse…:
Click User Collections or Device Collections as per deployment strategy and select the target devices and user for uninstallation.
Click OK and then Next.
Ensure Distribution point is shown in window.
Click Next.
In Deployment Setting, select Action as “Uninstall.”
Click Next and then Next.
In User Experience setting, select the dropdown for Hide in Software Center and all notifications as “User Notifications: setting”.
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.
Preventing Automatic Reinstallation of HP Components After Uninstallation
Uninstalling the HP Insights Windows Agent by using SCCM, Microsoft Intune, or the uninstall script removes the HPInsightsAgent and HPInsightsAnalytics application packages that are currently installed on the device. However, uninstalling these packages does not prevent them from being installed again later.
Reinstallation scenarios
HPInsightsAgent and HPInsightsAnalytics can be reinstalled in the following scenarios.
Smart Support enrollment: When
AllowSupportconsent is enabled during out-of-box experience (OOBE) or through HP Privacy Settings,HPServiceScancan enroll the device in HP Smart Support. During Smart Support enrollment,HPInsightsAgentandHPInsightsAnalyticscan be reinstalled as the required components of the Smart Support solution. For additional information, refer to HP Smart Support | HP® India.Windows Update delivery: When
AllowMarketingand/orAllowProductEnhancementconsent is enabled during OOBE or through HP Privacy Settings,HPInsightsAnalyticscan be offered again through Windows Update. In this case,HPInsightsAnalyticsis delivered as an HP Software Component driver package that is used for telemetry collection that supports product improvement, marketing, and support services.
Preventing reinstallation
To prevent these components from being reinstalled, IT administrators must block the corresponding HP Software Component driver packages through Windows Update management policies. For example, administrators can use driver exclusion policies, Windows Server Update Services (WSUS), Microsoft Intune, or SCCM controls. IT admins must also disable Smart Support enrollment mechanisms where applicable.
Contact Us
For any assistance, create a support case or email `support@wxp.hp.com`.