Forum Discussion

AB21805's avatar
AB21805
Bronze Contributor
Oct 14, 2021

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...
  • Rudy_Ooms_MVP's avatar
    Rudy_Ooms_MVP
    Oct 16, 2021

    AB21805 

    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).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

     

     

     

Resources