Forum Discussion

Re: Removing the incorrect office apps on devices

I guess that one is not the one you need 🙂

2 Replies

  • AB21805's avatar
    AB21805
    Bronze Contributor

    Hi Rudy_Ooms_MVP 

     

    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!

     

Resources