Oct 14 2021 05:18 AM
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 want on devices but within intune there is only one OFFICE we deploy which doesnt contain ONENOTE
When I remove Microsoft 365 - en-us manually onenote is removed
So does any one know how we remove the one that contains onenote?
Thanks in advance
Oct 15 2021 02:14 AM
Oct 15 2021 02:46 AM
Oct 15 2021 11:26 PM
Oct 16 2021 12:09 AM
SolutionHi, 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).UninstallString
ForEach ($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 18 2021 05:14 AM
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).UninstallString
ForEach ($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 2021 05:42 AM
Apr 07 2022 02:11 AM
I have tried this again which worked when doing it locally:
$OfficeUninstallStrings = ((Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*") |
Where {$_.DisplayName -like "Microsoft 365 - en-us"} |
Select UninstallString).UninstallString
ForEach ($UninstallString in $OfficeUninstallStrings) {
$UninstallEXE = ($UninstallString -split '"')[1]
$UninstallArg = ($UninstallString -split '"')[2] + " DisplayLevel=False"
Start-Process -FilePath $UninstallEXE -ArgumentList $UninstallArg -Wait
}
But when trying through intune it succeeds but office isnt removed! Any ideas where i am going wrong?
Please help!
Apr 07 2022 03:14 AM
Oct 16 2021 12:09 AM
SolutionHi, 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).UninstallString
ForEach ($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