Fully automate the removal of any Office version in preparation for Office 365

Companies moving to Office 365 will come across a hurdle. Historically Office installations have been different where as they install fully inside of Windows. With Office 365, it’s more like a stream rather than an install. As a result, when Office 365 is streamed to the computer, previous versions of Office are left installed, so you would effectively have two Office installations. Having two Office installations would be be confusing to the user and be very messy.

How has Office changed with Office 365?

Not too long ago Steve Ballmer the CEO announced that Microsoft would now be known as a devices and services company, here’s a link in case you didn’t see it http://news.cnet.com/8301-10805_3-57529238-75/microsoft-is-now-your-devices-and-services-company/

In saying this, the new product is called ‘Office 365’.  This includes all Office components including Lync.

clip_image002

You can’t even install Lync or any other individual Office 365 component by itself. See below, when I try to install Lync from the Microsoft Online Portal by itself, it clearly states that “Lync 2013 is included in the latest version of Office

clip_image004

So to simplify things, it’s all one single product called Office 365. As for what it is? Well essentially at the moment, it’s Office 2013 (but it’s not called Office 2013).

As an option, I don’t have to install Office 365, I can can still install Office 2013 only. See and read below carefully my ‘about’ screenshot.

clip_image006

In comparison, the ‘about’ screenshot on an Office 365 installation is slightly different, nowhere does it say Office 2013.

clip_image008

Office 365 streams and updates in the background automatically, meaning that updates rollout to people automatically, including any new versions. As I mentioned before, Microsoft is now a devices and services company (read between the lines) my tip is that Office 365 is here to stay and is simply a brand name. Currently they are utilising the latest Office 2013 software, but that can change in the future all automatically, as Office 365 is streamed and not installed. In contrast, Office 2013 is installed and can’t easily be updated automatically.

Below, Office 365 can only be installed 5 times and it keeps a track of where it’s installed on the Microsoft Online Portal.

clip_image010

More information here http://community.office365.com/en-us/blogs/office_365_technical_blog/archive/2013/03/06/office-365-proplus-administrator-series-client-deployment-options.aspx?ss=1283c51b-924e-4dff-bfaf-8a8533a24fb2

Solution to automatically uninstall any version of Office

This solution worked for us to automate the removal of Office 2003, Office 2007 and Office 2010. This will remove any version of Office whether it be 32-bit of 64-bit. It will work for all users whether they have admin access to their machines or not. This has been fully tested on Windows 7, however should work with no issues on other Windows versions.

Admin Experience:

For the administrator/project manager, when it comes time for a user to move to Office 365, you send an email to the user with a text file attachment called O551c3_0ut.txt. Ask the user to save the text file to their desktop and then close and save all their work and lock their computer before going to lunch. By this stage there’s already a Scheduled Task in place which is activated by the locking of the the computer. When the computer is locked, a batch file is run and checks for the existence of O551c3_0ut.txt anywhere under their user profile. If this file exists, the uninstall process will begin.

User Experience:

Quite simply, for the user, prior to the installation of Office 365, they simply save the O551c3_0ut.txt email attachment to their desktop, then simply lock their computer. So prior to going to lunch, when the computer is locked, this locking mechanism kicks off the batch file script to check the existence of O551c3_0ut.txt anywhere in the user profile (which includes the Desktop). The batch file will call the relevant VB script to uninstall Office silently in the background and will reboot upon completion.

image

Service account

You will need to create a service account to be used for the automated uninstall process. The account I used was a member of the Domain Admins group in Active Directory so that the account would have local admin access on all domain member machines by default. I called this account svc.admin_install

Group Policy

Create a user based group policy and map it to the OU which contains your users. Create a scheduled task, I called this Remove Office. Change the account that is used for the running of the task to the account you setup before and enter in the password when it prompts.

image

Change the trigger to ‘”On workstation lock”

image

For the action, add in “%windir%\Office_out.bat

image

Distribute the files to the computers

There are four files that need to be distributed to the computers. Using the same group policy object, configure Files under Group Policy preferences.

image

image

Enter the source path, create a share somewhere on your network.

For the destination enter the following:

  • %windir%\Office_out.bat
  • %windir%\OffScrub03.vbs
  • %windir%\OffScrub07.vbs
  • %windir%\OffScrub10.vbs

Files are available here https://onedrive.live.com/redir?resid=A19E3265DE255FBB!34941&authkey=!ADMcfY3onyOEhg8&ithint=folder%2cbat

The batch file

@echo off 

cd %SystemDrive%\users
 dir /s O551c3_0ut.txt
 if errorlevel 1 goto end 

dir /s O551c3_1n.txt
 if not errorlevel 1 goto end 

:remove Microsoft Office 2003 suites
 cscript %windir%\offscrub03.vbs ALL /Quiet /NoCancel 

:remove Microsoft Office 2007 suites
 cscript %windir%\offscrub07.vbs ALL /Quiet /NoCancel 

:remove Microsoft Office 2010 suites
 cscript %windir%\offscrub10.vbs ALL /Quiet /NoCancel 

echo Legacy Office Uninstall Finished > %SystemDrive%\users\O551c3_1n.txt 

shutdown /r /f 

:end
 exit

How do you know it’s running?

Open Task Manager and sort by username under Processes. You will see the processes running under the user account svc.admin_install. It will take the normal time to uninstall Office, and will reboot upon completion.

image

Flag Files

O551c3_0ut.txt – This file indicates that the script will actually run and start the uninstall process. This file is located %SystemDrive%\users
O551c3_1n.txt – This file indicates that all legacy versions of Office have been removed and is created upon completion of the uninstall script. This file is located %SystemDrive%\users

Where did the scripts come from?

The scripts came from Microsoft http://support.microsoft.com/kb/290301 There are several Microsoft Fix iT utilities used to completely uninstall Office 2003, Office 2007 and Office 2010. So they can be trusted.

Automate the installation of Office 365

Now that you have completed removing all Office versions from the computers, you will need to install Office 365 automatically and silently using Group Policy and source files from a local repository. My other blog post discusses a solution that worked for us, to install Office 365 in a corporate environment and fits nicely to the end of this uninstall process.

13 Comments

  1. […] post continues on from my other blog post Fully automate the removal of any Office version in preparation for Office 365. Once all Office software versions have been removed from the computer, you’ll then need to […]

  2. Valdis

    there are problems remove 32 bit Office 2010 from 64 bit Windows 7 machine.

  3. Great article/tutorial.. I was banging my head for this exact solution. Thanks much.

  4. read the article

    Fully automate the removal of any Office version in preparation for Office 365 | Marc Kean

  5. Thanks very much

  6. Works great! I had to turn off Stage 1 “Component Detection” to be able to run the uninstallation automaticly. This was because of Lotus Notes installation present on the client.

  7. I’ve found remove script for office 2013 which also might be usefull for some of you. Take a look here: https://gist.github.com/CHEF-KOCH/7872799

  8. This solution will no longer work since the release of MS14-025. It stops you from being able to embed passwords in scheduled tasks via GPO.

  9. skip hire alternative Forest Hill

    Fully automate the removal of any Office version in preparation for Office 365 | Marc Kean

  10. Kitchen UK

    Fully automate the removal of any Office version in preparation for Office 365 | Marc Kean

  11. investing blog

    Fully automate the removal of any Office version in preparation for Office 365 | Marc Kean

  12. Hello, downloading does not work, someone help me ?? Files are available here http://sdrv.ms/17hSpmV

    1. Link is fixed – please check

Leave a comment