Hey everyone! I'm tasked with upgrading our entire organization from Office 2016 to Office 365. I'm trying to deploy this upgrade using Ninja RMM silently with a PowerShell script. However, I've run into some issues since I need to uninstall Office 2016 before I can install 365, and the uninstall process doesn't go quietly—it requires admin credentials. Has anyone else faced this before? I'll be discussing it with my coworker tomorrow as he's more experienced with PowerShell than I am. Thanks for any help!
5 Answers
Have you looked into using the Office Deployment Tool (ODT)? It has uninstall parameters specifically designed for older versions of Office, but they apply to MSI installs only. It could be a good way to manage your upgrade.
If you need a script, there’s a 365 install script in the Ninja RMM template library that works out of the box. You can edit the XML section if you want to exclude certain apps. Here’s a quick example for uninstallation:
```powershell
# Run as Administrator
Write-Host "Scanning for installed Office products..." -ForegroundColor Cyan
# Function to uninstall Office Click-to-Run products
function Uninstall-OfficeClickToRun { ... }
# Function to uninstall Office via registry (for older MSI installs)
function Uninstall-OfficeMSI { ... }
# Main execution
Uninstall-OfficeClickToRun
Uninstall-OfficeMSI
...```
This combines uninstalling Click-to-Run products and MSI installs, so it should help streamline the upgrade process.
We just did a similar upgrade, moving from Office 2019 to LTSC via Ninja RMM. We configured a custom ODT file that handled the uninstallation of the older Office version. It worked well. Just make sure you set it to force close any open applications before the install.
Have you tried using winget for the uninstall? It might be worth a shot if you're looking for alternatives.
How many computers are you upgrading?
About 150 in total.