Last active
November 5, 2024 17:55
-
-
Save mark05e/a79221b4245962a477a49eb281d97388 to your computer and use it in GitHub Desktop.
Remove HP bloatware
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ██████╗ ███████╗███╗ ███╗ ██████╗ ██╗ ██╗███████╗ ██╗ ██╗██████╗ | |
# ██╔══██╗██╔════╝████╗ ████║██╔═══██╗██║ ██║██╔════╝ ██║ ██║██╔══██╗ | |
# ██████╔╝█████╗ ██╔████╔██║██║ ██║██║ ██║█████╗ ███████║██████╔╝ | |
# ██╔══██╗██╔══╝ ██║╚██╔╝██║██║ ██║╚██╗ ██╔╝██╔══╝ ██╔══██║██╔═══╝ | |
# ██║ ██║███████╗██║ ╚═╝ ██║╚██████╔╝ ╚████╔╝ ███████╗ ██║ ██║██║ | |
# ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚══════╝ ╚═╝ ╚═╝╚═╝ | |
# | |
# ██████╗ ██╗ ██████╗ █████╗ ████████╗██╗ ██╗ █████╗ ██████╗ ███████╗ | |
# ██╔══██╗██║ ██╔═══██╗██╔══██╗╚══██╔══╝██║ ██║██╔══██╗██╔══██╗██╔════╝ | |
# ██████╔╝██║ ██║ ██║███████║ ██║ ██║ █╗ ██║███████║██████╔╝█████╗ | |
# ██╔══██╗██║ ██║ ██║██╔══██║ ██║ ██║███╗██║██╔══██║██╔══██╗██╔══╝ | |
# ██████╔╝███████╗╚██████╔╝██║ ██║ ██║ ╚███╔███╔╝██║ ██║██║ ██║███████╗ | |
# ╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ | |
# | |
# Remove HP bloatware / crapware | |
# | |
# -- source : https://gist.github.com/mark05e/a79221b4245962a477a49eb281d97388 | |
# -- contrib: francishagyard2, mark05E, erottier, JoachimBerghmans, sikkepitje | |
# -- ref : https://community.spiceworks.com/topic/2296941-powershell-script-to-remove-windowsapps-folder?page=1#entry-9032247 | |
# -- note : this script could use your improvements. contributions welcome! | |
# -- todo : Wolf Security improvements ref: https://www.reddit.com/r/SCCM/comments/nru942/hp_wolf_security_how_to_remove_it/ | |
# List of built-in apps to remove | |
$UninstallPackages = @( | |
"AD2F1837.HPJumpStarts" | |
"AD2F1837.HPPCHardwareDiagnosticsWindows" | |
"AD2F1837.HPPowerManager" | |
"AD2F1837.HPPrivacySettings" | |
"AD2F1837.HPSupportAssistant" | |
"AD2F1837.HPSureShieldAI" | |
"AD2F1837.HPSystemInformation" | |
"AD2F1837.HPQuickDrop" | |
"AD2F1837.HPWorkWell" | |
"AD2F1837.myHP" | |
"AD2F1837.HPDesktopSupportUtilities" | |
"AD2F1837.HPQuickTouch" | |
"AD2F1837.HPEasyClean" | |
"AD2F1837.HPSystemInformation" | |
) | |
# List of programs to uninstall | |
$UninstallPrograms = @( | |
"HP Client Security Manager" | |
"HP Connection Optimizer" | |
"HP Documentation" | |
"HP MAC Address Manager" | |
"HP Notifications" | |
"HP Security Update Service" | |
"HP System Default Settings" | |
"HP Sure Click" | |
"HP Sure Click Security Browser" | |
"HP Sure Run" | |
"HP Sure Recover" | |
"HP Sure Sense" | |
"HP Sure Sense Installer" | |
"HP Wolf Security" | |
"HP Wolf Security Application Support for Sure Sense" | |
"HP Wolf Security Application Support for Windows" | |
) | |
$HPidentifier = "AD2F1837" | |
$InstalledPackages = Get-AppxPackage -AllUsers ` | |
| Where-Object {($UninstallPackages -contains $_.Name) -or ($_.Name -match "^$HPidentifier")} | |
$ProvisionedPackages = Get-AppxProvisionedPackage -Online ` | |
| Where-Object {($UninstallPackages -contains $_.DisplayName) -or ($_.DisplayName -match "^$HPidentifier")} | |
$InstalledPrograms = Get-Package | Where-Object {$UninstallPrograms -contains $_.Name} | |
# Remove appx provisioned packages - AppxProvisionedPackage | |
ForEach ($ProvPackage in $ProvisionedPackages) { | |
Write-Host -Object "Attempting to remove provisioned package: [$($ProvPackage.DisplayName)]..." | |
Try { | |
$Null = Remove-AppxProvisionedPackage -PackageName $ProvPackage.PackageName -Online -ErrorAction Stop | |
Write-Host -Object "Successfully removed provisioned package: [$($ProvPackage.DisplayName)]" | |
} | |
Catch {Write-Warning -Message "Failed to remove provisioned package: [$($ProvPackage.DisplayName)]"} | |
} | |
# Remove appx packages - AppxPackage | |
ForEach ($AppxPackage in $InstalledPackages) { | |
Write-Host -Object "Attempting to remove Appx package: [$($AppxPackage.Name)]..." | |
Try { | |
$Null = Remove-AppxPackage -Package $AppxPackage.PackageFullName -AllUsers -ErrorAction Stop | |
Write-Host -Object "Successfully removed Appx package: [$($AppxPackage.Name)]" | |
} | |
Catch {Write-Warning -Message "Failed to remove Appx package: [$($AppxPackage.Name)]"} | |
} | |
# Remove installed programs | |
$InstalledPrograms | ForEach-Object { | |
Write-Host -Object "Attempting to uninstall: [$($_.Name)]..." | |
Try { | |
$Null = $_ | Uninstall-Package -AllVersions -Force -ErrorAction Stop | |
Write-Host -Object "Successfully uninstalled: [$($_.Name)]" | |
} | |
Catch {Write-Warning -Message "Failed to uninstall: [$($_.Name)]"} | |
} | |
# Fallback attempt 1 to remove HP Wolf Security using msiexec | |
Try { | |
MsiExec /x "{0E2E04B0-9EDD-11EB-B38C-10604B96B11E}" /qn /norestart | |
Write-Host -Object "Fallback to MSI uninistall for HP Wolf Security initiated" | |
} | |
Catch { | |
Write-Warning -Object "Failed to uninstall HP Wolf Security using MSI - Error message: $($_.Exception.Message)" | |
} | |
# Fallback attempt 2 to remove HP Wolf Security using msiexec | |
Try { | |
MsiExec /x "{4DA839F0-72CF-11EC-B247-3863BB3CB5A8}" /qn /norestart | |
Write-Host -Object "Fallback to MSI uninistall for HP Wolf 2 Security initiated" | |
} | |
Catch { | |
Write-Warning -Object "Failed to uninstall HP Wolf Security 2 using MSI - Error message: $($_.Exception.Message)" | |
} | |
# # Uncomment this section to see what is left behind | |
# Write-Host "Checking stuff after running script" | |
# Write-Host "For Get-AppxPackage -AllUsers" | |
# Get-AppxPackage -AllUsers | where {$_.Name -like "*HP*"} | |
# Write-Host "For Get-AppxProvisionedPackage -Online" | |
# Get-AppxProvisionedPackage -Online | where {$_.DisplayName -like "*HP*"} | |
# Write-Host "For Get-Package" | |
# Get-Package | select Name, FastPackageReference, ProviderName, Summary | Where {$_.Name -like "*HP*"} | Format-List | |
# # Feature - Ask for reboot after running the script | |
# $input = Read-Host "Restart computer now [y/n]" | |
# switch($input){ | |
# y{Restart-computer -Force -Confirm:$false} | |
# n{exit} | |
# default{write-warning "Skipping reboot."} | |
# } |
It's a smart step to deploy this in an app, if you don't have the required
license to use remediation scripts.
You could also try
https://gist.github.com/mark05e/2db81671f39a041a5992a64a77748dc7
As always, use at your own risk. I urge you to test thoroughly before
deploying it with Intune. You're very welcome to share any improvements
here.
met vriendelijke groeten,
Paul Wiegmans 🐬
Op vr 3 mei 2024 om 12:18 schreef Besta344 ***@***.***>:
… ***@***.**** commented on this gist.
------------------------------
Hi all,
We want to use this script with Intune, and I saw an earlier comment that
this has been done with Remediation but sadly we cannot do that because you
need a different License such as E3, E5, A3 or A5.
So, we created an App with the script and tested it with a laptop. When
the script was done, we got a message on the device if you are sure to
remove HP Support Assistant (Can you force this?) and a lot of other HP
Bloatware was still installed such as HP Wolf Security. We also kept
getting messages about Can’t install ‘Script name’
We used the original Remove-HPbloatware.ps1 script. Is this the best
option if you can’t do it with Remediation? And what is the best way to
detect the script (To look for a File or with a detection script)?
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/mark05e/a79221b4245962a477a49eb281d97388#gistcomment-5044866>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADMFD7EHFDYOJWDRVZNRBO3ZANP6ZBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTAOBXG42DQNBTU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
We recently onboarded a new client who have some windows 8 era HP AIOs and found a few more applications and packages that weren't accounted for in the current iteration. This script seems more targeted to new HP deployments, but is equally useful for old deployments that still have the bloat present.
I have not run the script yet with the modifications, but here's our current list. I realize this is for HP bloatware, but I've included Mcafee, wildtangent, and candy crush as well.
# List of built-in apps to remove
$UninstallPackages = @(
"AD2F1837.HPJumpStarts"
"AD2F1837.HPPCHardwareDiagnosticsWindows"
"AD2F1837.HPPowerManager"
"AD2F1837.HPPrivacySettings"
"AD2F1837.HPSupportAssistant"
"AD2F1837.HPSureShieldAI"
"AD2F1837.HPSystemInformation"
"AD2F1837.HPQuickDrop"
"AD2F1837.HPWorkWell"
"AD2F1837.myHP"
"AD2F1837.HPDesktopSupportUtilities"
"AD2F1837.HPQuickTouch"
"AD2F1837.HPEasyClean"
"AD2F1837.HPSystemInformation"
"AD2F1837.HPConnectedMusic"
"AD2F1837.HPFileViewer"
"AD2F1837.HPRegistration"
"AD2F1837.HPWelcome"
"AD2F1837.HPConnectedPhotopoweredbySnapfish"
"AD2F1837.HPPrinterControl"
"king.com.CandyCrushSodaSaga"
)
# List of programs to uninstall
$UninstallPrograms = @(
"HP Connection Optimizer"
"HP Documentation"
"HP Dropbox Plugin"
"HP EmailSMTP Plugin"
"HP ePrint SW"
"HP FTP Plugin"
"HP Google Drive Plugin"
"HP JumpStart Apps"
"HP JumpStart Bridge"
"HP JumpStart Launch"
"HP MAC Address Manager"
"HP Notifications"
"HP OneDrive Plugin"
"HP PC Hardware Diagnostics Windows"
"HP Scan Twain"
"HP SFTP Plugin"
"HP SharePoint Plugin"
"HP Support Solutions Framework"
"HP System Event Utility"
"HP System Info HSA Service"
"HP Security Update Service"
"HP System Default Settings"
"HP Sure Click"
"HP Sure Click Security Browser"
"HP Sure Run"
"HP Sure Run Module"
"HP Sure Recover"
"HP Sure Sense"
"HP Sure Sense Installer"
"HP Wolf Security"
"HP Wolf Security - Console"
"HP Wolf Security Application Support for Sure Sense"
"HP Wolf Security Application Support for Windows"
"McAfee Security Scan Plus"
"WebAdvisor by McAfee"
"WildTangent Games"
)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all,
We want to use this script with Intune, and I saw an earlier comment that this has been done with Remediation but sadly we cannot do that because you need a different License such as E3, E5, A3 or A5.
So, we created an App with the script and tested it with a laptop. When the script was done, we got a message on the device if you are sure to remove HP Support Assistant (Can you force this?) and a lot of other HP Bloatware was still installed such as HP Wolf Security. We also kept getting messages about Can’t install ‘Script name’
We used the original Remove-HPbloatware.ps1 script. Is this the best option if you can’t do it with Remediation? And what is the best way to detect the script (To look for a File or with a detection script)?