Forum Discussion
Removing the incorrect office apps on devices
- 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
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
- AB21805Oct 18, 2021Bronze Contributor
I am unable to remove office
Here is the script (which I have tried to run manually on the device rather than intune first)
$OfficeUninstallStrings = ((Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*") |
Where {$_.DisplayName -like "Office 16 Click-to-Run Licensing Component"} |
Select UninstallString).UninstallStringForEach ($UninstallString in $OfficeUninstallStrings) {
$UninstallEXE = ($UninstallString -split '"')[1]
$UninstallArg = ($UninstallString -split '"')[2] + " DisplayLevel=False"
Start-Process -FilePath $UninstallEXE -ArgumentList $UninstallArg -Wait
}Any idea where I am going wrong?
- Oct 18, 2021I guess that one is not the one you need 🙂