Earlier this year I did a presentation at the Central Texas Systems Management User Group (CTSMUG) in Austin on migrating our company to Office 2016 (MSI). I have provided a link to my Sway of that presentation for some general context however this blog post will be a more technical explanation of how I went about upgrading all our systems to Office 2016.
- Working knowledge of ConfigMgr 2012/Current Branch Task Sequences.
- An existing Application/Package for installing Office 2016/365, Visio, Project, etc. (If you need assistance with this, there is plenty of guidance here and here)
Before we get going, we need to create a new package called “Office 2016 Upgrade Files”. This package will consist of detection scripts, Office Scrub scripts and any other custom code used for your overall upgrade process. (NOTE: This package should NOT contain any of the actual Office installer binaries).
New-CMPackage -Name 'Microsoft Office 2016 Upgrade Files' -Path '\\SERVER\SOURCES\Microsoft Office 2016 Upgrade Files'
Start by downloading the following scripts:
- Get-MSOfficeProducts.ps1 – I developed this script to detect as many Microsoft Office (non-server) products that I had in my environment (NOTE: The language packs section needs improvement to cover more languages).
- IME14-Cleanup.ps1 – This cleans up registry keys associated with the Office IME (Input Method Editor).
Next, use the “Easy Fix Download” link to obtain and extract the Office Scrub scripts for Office 2010+
- Office 2010 Scrub Script Extract the OffScrub10.vbs and add it to your Office Upgrade package:
- Office 2013/2016/365 Scrub Script Extract the OffScrub scripts from the EasyFix download and add them to your Office Upgrade package:
Task Sequence – Detection
Start out by creating a new (empty) Custom Task Sequence. The first stage of our Task Sequence will include detecting the software currently installed on the system. This is broken out (generally) into two different groups.
- Microsoft Office Suites and Applications (i.e. Visio, Project, Language Packs)
- Office-Dependent Applications – Other software packages that have a dependency on one or more Office applications that may need special attention (reinstall) during an Office upgrade.
The next section will contain various scripts and command lines that we’ll use to remove Office-Dependent products and Office itself. First off, create a group (generally via WMI query or a file check) to detect and remove each application. Be sure to add a custom Task Sequence variable as indicated in the screenshot above so you can use that to re-install the software later.
You “CAN” upgrade Office in-place without removing previous suites, however I always run into legacy shared components that get left behind. When these are left behind, the system still downloads ALL of the updates for the full suite (including service packs) so I prefer to perform a rip and replace of the Office suite.
Once you have removed the Office-Dependent applications, the next set of steps will systematically remove Microsoft Office. I’ll list this out in order of how we did it as we had excellent success with this specific order of operations no matter what the system had installed.
- Remove Microsoft Office – This uses the Get-MSOfficeProducts.ps1 script from the Detection step but with the added –Uninstall parameter. This step works well to remove Office 2003 components and some of the newer components using standard methods. NOTE: There is an Office Scrub script for Office 2003 available however I never verified that it worked.
- Uninstall Office 2007 – I used the main Office 2007 Professional Plus installation media with custom Uninstall XML files to remove SharePoint Designer, Proofing Tools and the rest of the suite (in that order) since I already had the original package used to install it. I’m not doing anything else related to Visio/Project or Language Packs during this section. NOTE: There is an Office Scrub script for Office 2007 available however I never verified that it worked.
- Uninstall Office 2010/2013/2016 – Microsoft has published “scrub” scripts for each version of Office that work incredibly well. Set these up as Run Command Line Steps in your Task Sequence with the following Command Line parameters for each:
Scrub Office 2010
cscript.exe OffScrub10.vbs ALL /log "C:\Windows\Temp" /quiet
Scrub Office 2013
cscript.exe OffScrub15.vbs ALL /log "C:\Windows\Temp" /quiet
Scrub Office Click-To-Run – Use this if you are installing Office 2016 MSI
cscript.exe OffScrubc2r.vbs ALL /log "C:\Windows\Temp" /quiet
Scrub Office 2016 – Use this if you are installing Office 365 Click-To-Run
cscript.exe OffScrub16.vbs ALL /log "C:\Windows\Temp" /quiet
NOTE: The scrub scripts run twice as sometimes the scrub fails due to a corrupted installation. Running it twice typically takes care of things.
NOTE: You’ll want to run the Office 2016/C2R scripts to remove any potentially conflicting applications before installing Office. C2R and MSI (2016) builds cannot co-exist.
Install Office 2016/365
Before you start installing Office 2016/365, consider rebooting the system. This can often be required if you had to remove other Non-Office applications as part of your upgrade path.
I’m using the Application Model for all Office installers. I have separate applications for the Office Suite separating 32-bit/64-bit. All other Office components have both 32-bit and 64-bit within the same application.
During this section is where we will leverage the Task Sequence variables created by the Get-MSOfficeProducts.ps1 script to determine which components to reinstall.
Microsoft Office ProPlus Suite (32-bit/64-bit)
Use the MsOfficeSuiteArch TS Variable to determine which architecture of Office to install.
Microsoft Project (Standard/Professional)
Use the MsProjectStd or MsProjectPro TS Variables to determine if Project Standard or Professional needs to be reinstalled.
Microsoft Visio (Standard/Professional)
Use the MsVisioStd, MsVisioPrm or MsVisioPro TS Variables to determine if Visio Standard or Professional needs to be reinstalled.
Microsoft Proofing Tools Kit
Use the MsProofKit TS Variable to determine if the Proofing Tools Kit needs to be reinstalled.
Microsoft Office Language Packs
We use the Application Model for installing Office Language Packs. These are separated by Language, and contain Deployment Types for each Office Version/Architecture to make things easy (for us and the end user). Take note of the priority order.
Use the following TS Variables for Language selection:
Re-Install Additional Applications
Here is where we begin reinstalling all of our Non-Office applications back onto the system. This could either be a simple re-install, configuration change, or an update to an application to enable compatibility with the Office 2016 suite.
We ran into some issues with KMS activation during our upgrades (using the MSI installer) so we added in the necessary ospp.vbs commands to activate Office in an attempt to “force” activation immediately after installation. This reduced the number of helpdesk calls we received when activation took longer than normal.End Notification
Finally, we end the deployment by forcing a machine policy update, copying off log files and notifying the end user that the upgrade is complete (Notification HTA runs via the RunOnce registry key).