Migrate Office 2016 and 2019 MSI installations on Windows endpoints to Microsoft 365 Apps using the Office Deployment Tool
This Automox Worklet™ migrates Windows endpoints from legacy Microsoft Office MSI installations to Microsoft 365 Apps for enterprise (formerly Office 365 ProPlus). The Worklet follows the upgrade path Microsoft documents for moving an MSI fleet onto the Click-to-Run channel: download the Office Deployment Tool, write a configuration.xml that contains a RemoveMSI element plus a Microsoft 365 Add block, then run setup.exe /configure against that file to uninstall the old Office and install the new one in a single pass.
The evaluation script uses the Automox Windows Detection Kit (Get-Win32App with IsMSI) to identify Office 2016 or 2019 installed via MSI. It catches the full edition matrix: Home and Business, Home and Student, Personal, Professional, Professional Plus, and Standard. Click-to-Run installations are deliberately excluded, because Click-to-Run already lives on the Microsoft 365 servicing model and uses a different uninstall path.
Remediation generates a configuration.xml at runtime from your policy parameters, downloads the latest officedeploymenttool*.exe from Microsoft, extracts setup.exe, and runs setup.exe /configure configuration.xml. FORCEAPPSHUTDOWN is enabled, so Outlook, Word, Excel, and PowerPoint are closed before the swap. The end-to-end run typically takes 20–30 minutes on a 100 Mbps link, depending on which Microsoft 365 product and language pack you deploy.
Office 2016 mainstream support has lapsed and Office 2019 is on its final extended-support runway. Endpoints still running Office MSI receive no feature updates and a shrinking trickle of security fixes, even though Word, Outlook, and Excel remain the daily handling surface for sensitive documents, signed PDFs, and email-borne payloads. Microsoft 365 Apps for enterprise replaces that risk profile with the Click-to-Run servicing model: monthly security updates, side-by-side install with per-app rollback, and centralized policy through the Microsoft 365 admin center. The MSI-to-Click-to-Run move is also the path Microsoft requires for licensing alignment once an organization has Microsoft 365 seats on file.
The Microsoft 365 license is already on every seat in most organizations, but the legacy Office MSI installs still in production block the Click-to-Run feature stream and accumulate end-of-support advisories. This Worklet walks each Windows endpoint through the OfficeClickToRun RemoveMSI step and then runs the Office Deployment Tool with the productId and channel you specify in the policy. Schedule it against your Office MSI endpoint group and let the same maintenance cadence used for everything else retire the legacy install across the fleet.
Evaluation phase: The Worklet imports the Automox Windows Detection Kit and calls Get-Win32App, filtering on IsMSI = $true and a Name match list covering Microsoft Office 2016 and 2019 across all retail and volume editions (Home and Business, Home and Student, Personal, Professional, Professional Plus, Standard). Endpoints with at least one matching MSI registration are flagged non-compliant and queued for remediation. Click-to-Run installations and Office 2021 / LTSC installations are not matched, so the policy is safe to schedule against a mixed fleet.
Remediation phase: The script creates C:\ProgramData\amagent\WorkletCache\WSE-903, downloads the latest officedeploymenttool*.exe from the Microsoft Download Center over TLS 1.2, and extracts setup.exe. It then writes a configuration.xml containing a <Remove All="TRUE" /> block guarded by <RemoveMSI /> and an <Add> block parameterized by productId (default O365ProPlusRetail), clientEdition (32 or 64), languageId (default en-us), channel (default Current), excludeAppIds, and ignoreProductIds. Finally it runs setup.exe /configure configuration.xml with FORCEAPPSHUTDOWN=TRUE, waits for ODT to exit, and verifies that a Microsoft 365 Apps registration is present in the uninstall registry hive. The exit code from setup.exe is surfaced in the Automox activity log.
Windows 10 or Windows 11 endpoint with Microsoft Office 2016 or 2019 installed via MSI (not Click-to-Run, not Office LTSC 2021)
Local administrator rights on the Automox agent (the default agent context already meets this)
Outbound HTTPS to officecdn.microsoft.com and download.microsoft.com on TLS 1.2, plus reachability to the Microsoft 365 servicing channel CDN for the chosen channel
Valid Microsoft 365 license bound to the signed-in user for the target productId (commonly O365ProPlusRetail or O365BusinessRetail)
Policy parameters: productId (default O365ProPlusRetail), clientEdition (32 or 64), languageId (default en-us), channel (Current, MonthlyEnterprise, or SemiAnnual)
Optional excludeAppIds (for example Lync, Groove, OneDrive) to skip individual Microsoft 365 apps, and optional ignoreProductIds to leave Project, Visio, or another co-installed MSI product in place
3–5 GB of free disk on the system drive for the staged installer and the streamed Microsoft 365 source
Maintenance window of 20–30 minutes per endpoint for the full RemoveMSI plus Click-to-Run install pass
After a successful run, the endpoint has Microsoft 365 Apps for enterprise (or the productId you specified) registered under HKLM:\SOFTWARE\Microsoft\Office\ClickToRun and a single Microsoft 365 entry under Add/Remove Programs. The legacy Office 2016 or 2019 MSI entries are gone, along with their uninstall keys under HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. Word, Excel, Outlook, and PowerPoint launch on the Microsoft 365 channel you selected, and File > Account inside any Office app reports the matching update channel. The next evaluation finds no MSI Office and marks the endpoint compliant without remediating again.
Installation logs and the rendered configuration.xml are preserved at C:\ProgramData\amagent\WorkletCache\WSE-903 for post-run review. On failure, setup.exe most commonly returns exit code 1603 (generic install failure) or 17002 (download or Click-to-Run service issue); the activity log carries the full stderr from ODT. For Office 2007 through 2013 MSI versions the ODT RemoveMSI path does not apply – use the Office Scrub Tool first, then re-target this Worklet. For endpoints already on Click-to-Run that need a clean reinstall, use the dedicated Office Click-to-Run uninstall Worklet rather than this one, because RemoveMSI is a no-op against a Click-to-Run registration.


Loading...
Consider Worklets your easy button
A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklets deploy named-CVE mitigations within hours of disclosure, perform configuration, remediation, and install or remove applications and settings across Windows, macOS, and Linux.

AUTOMOX + WORKLETS™
Uncover new possibilities with simple, powerful automation.
By submitting this form you agree to our Master Services Agreement and Privacy Policy
By submitting this form you agree to our Master Services Agreement and Privacy Policy.
Already have an account? Log in