Monday, December 14, 2015

Downgrade Office 365 2013

As mentioned previously, we use O365 Pro Plus Click-to-Run and control its update process via DFS and SCCM. We ran into some trouble recently with 15.0.4771.1003 causing Outlook and Skype for Business crashing. Both our PTG and TEST groups were on this buggy version since it was being tested before PROD rollout and we needed to downgrade them to 15.0.4763.1003 that was in PROD which worked fine. The TEST group consisted of IT and other key groups, including our helpdesk who uses Skype for Business so they had a rough time.

Per KB2770432 you can revert by running 'officec2rclient.exe /update user updatetoversion=15.0.xxxx.yyyy' as long as that version is in the O365 install path it knows about in the registry. Easy enough, however there are two minor things at play so I wrote a simple BAT file that we pushed out via ConfigMgr.

One, as I mentioned previously we use a baseline in ConfigMgr to set the install path in the registry. Different groups are on different versions so first we had to disable the baseline for a while. We could have changed the path related in the baseline, but that would have taken longer to process so we chose to change it on the fly in the script.

Two, is the arch of the Operating System. Even though you are using the 32-Bit arch of Office 365 yet you are using the 64-Bit arch of Windows the path to officec2rclient.exe is different so we had to address that execution.

First is the determination of what arch of the Operating System we are using.

 :: Check OS Architecture and run correct version of downgrade app  
 :CheckOS Arch  
 IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64BIT) ELSE (GOTO 32BIT)  

Once that was determined, we just run the relevant version of the tool while passing the version we want to change to.

 :64BIT  
 %WINDIR%\sysnative\reg.exe add "HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration" /v "UpdateUrl" /t REG_SZ /d "\\my.company.com\path\to\files" /f  
 "%ProgramW6432%\Microsoft Office 15\ClientX64\officec2rclient.exe" /update user updatetoversion=%1  
 GOTO END  
 :32BIT  
 %WINDIR%\system32\reg.exe add "HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration" /v "UpdateUrl" /t REG_SZ /d ""\\my.company.com\path\to\files" /f  
 "%programfiles%\Microsoft Office 15\ClientX86\officec2rclient.exe" /update user updatetoversion=%1  

Not so fast there buddy. ConfigMgr runs a script in 32-Bit environment so we had to use the %ProgramW6432% system variable vs %ProgramFiles% on 64-Bit Windows. You can see this if you run CMD from both %WINDIR%\System32 and %WINDIR%\SysWow64. The path for %ProgramFiles% will be different depending which arch your running out of. Also of note, on a 64-Bit system, 32-Bit O365 C2R is installed under %ProgramFiles% and not %ProgramFiles(x86)% as expected.

The script changed the path in the registry to the location of the version we wanted and then ran the tool to downgrade it. After pushing it out we transitioned just under two thousand impacted systems within a few hours. The way its written, we just advertise it and update the exe to run with the version we want moved to. Once a new version came out we just re-enabled the baseline for TEST and PTG and they got the recently released 15.0.4779.1002 that is supposed to fix the problem with these two applications.

Couple changes would facilitate this working in 2016 version of Office 365 Click-to-Run as well since the registry path and the file system path have changed.

Download

This script is provided as-is, no warranty is provided or implied.The author is NOT responsible for any damages or data loss that may occur through the use of this script.  Always test, test, test before rolling anything into a production environment.

You can find the downgrade script here.


-Kevin Fason




No comments:

Post a Comment