Forum Discussion
AB21805
Oct 14, 2021Bronze Contributor
Removing the incorrect office apps on devices
Hi all, I have a strange thing with all our intune devices, we have 2 offices installed: I need to remove the top one (Microsoft 365 - en-us) as it contains ONENOTE which we dont wa...
- Oct 16, 2021
Hi, just changed some lines it ... nothing much but again.. you will need to change the displayname to exactly the app you whish to remove 🙂
$OfficeUninstallStrings = ((Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*") |
Where {$_.DisplayName -like "Microsoft 365 Apps for enterprise - en-us"} |
Select UninstallString).UninstallStringForEach ($UninstallString in $OfficeUninstallStrings) {
$UninstallEXE = ($UninstallString -split '"')[1]
$UninstallArg = ($UninstallString -split '"')[2] + " DisplayLevel=False"
Start-Process -FilePath $UninstallEXE -ArgumentList $UninstallArg -Wait
}Looks like its working at my end
Oct 16, 2021
I will take a look what happens when I run it on a test device this afternoon, i will keep you posted!