Note: Article updated October 2018 to remove references to “Office 2016” and replace it with “Office 365 ProPlus” as the rollover to the 2019 release is seamless and does not change this products name.
Note: Article updated April 2018 Mid 2020 to support the new Channel names and XML updates and the new name for the product (Microsoft 365 Apps for enterprise).
Microsoft 365 Apps for enterprise (aka Office 365 ProPlus) Click To Run (which comes with Office 365 subscriptions) can be deployed via Group Policy, but there are a few things that you need to know and do first. These are:
- You cannot use the โSoftware Installationโ features of GPOโs to deploy the installer click to run software as this is an exe file, and โSoftware Installationโ runs MSI files.
- You cannot run software with elevated installation rights, as the setup.exe shells out to other processes to run the installation (the officeclick2run.exe service).
- You cannot just drop the latest versions of the files in an existing 2013 deployment folder and expect the clients to update automatically โ you must install 2016 to upgrade it and install it for the first time. This is not the case with the “2019” release. An existing installation installed before the “2019” release in October 2018 will seamlessly move to this version at the next applicable update.
Therefore you need to deploy the software via a computer startup script. But this is not simple either as startup scripts run each time the computer starts up (obviously!) but will run regardless of whether the software is already installed. Therefore you need to run the installation by way of a startup script that first checks if Office 365 ProPlus click to run has already been installed or not.
To do this you need to following:
- A read only file share containing the Office 2016 click to run files. Not this folder should not be the folder that already contains the Office 2013 files if you have them on your network.
- A read/write file share to store log files on (the deployment script logs the start and completion of the installation in a central location)
- An XML file to install Office 365 ProPlus click to run customised to your environment and the fact that you are using GPO deployment
- A batch file to detect an existing Office 365 ProPlus click to run deployment and if not present to install Office 365 ProPlus click to run from your file share.
- And finally the Office Deployment Tool setup program. This software has been updated a few times over the years, so ensure you download the current version before starting.
Steps 1 and 4 are part of a standard Office 365 ProPlus click to run deployment process and so not covered in this blog post. But once you have downloaded the Office Deployment Tool and created the XML using the creator tool at https://config.office.com you have your configuration.xml file. In step 3 you can run the deployment tool with setup.exe /download configuration.xml to download the Office binaries to the file share mentioned in step 1. If you have Office 2013 already deployed via this method (see http://c7solutions.com/2014/09/installing-office-365-proplus-click-to-run-via-gpo-deployment for these steps) then make sure that this folder for the binaries is not the same folder as contains 2013 files. The Office installer for Office 2013 Click To Run creates a subfolder called Office then another subfolder called Data. Into this it places v32.cab (or v64.cab) and other files. This cab file contains info relating to the version number of the software in this folder and if you download the current version to the same folder it will replace this file, but 2013 installed machines will still try and upgrade from this folder and fail. Therefore create another folder. This is shown in the example scripts below.
So here are the steps and details for doing all this for GPO deployment:
Creating Deployment File Shares
Create a software deployment file share that you have read/write access to and everyone else read only and create a folder called Office365ProPlus inside this to store the binaries.
Create a second file share that everyone has read/write access to (or CREATOR OWNER has write so that only the creator of the file can write it to the share and others can read or not see it at all). Create a sub folder in InstallLogs called Office365ProPlus.
In my demo these two shares and subfolders are called \\server\Software\Office365ProPlus and \\server\InstallLogs\Office365ProPlus.
Create an XML File for Office 2016 Click to Run Deployment
This XML file is as follows and is saved to \\server\Software\Office365ProPlus root folder. Call this file config.xml. You can create this XML file using the wizard at https://config.office.com
<Configuration>
<Info Description="" />
<Add SourcePath="\\server\Software\Office365ProPlus\" OfficeClientEdition="64" Channel="MonthlyEnterprise" MigrateArch="TRUE">
<Product ID="O365ProPlusRetail">
<Language ID="de-de" />
<Language ID="MatchPreviousMSI" />
<ExcludeApp ID="Groove" />
<ExcludeApp ID="Lync" />
</Product>
<Product ID="LanguagePack">
<Language ID="de-de" />
<Language ID="MatchPreviousMSI" />
</Product>
</Add>
<Updates Enabled="TRUE" UpdatePath="\\server\Software\Office365ProPlus\" Channel="MonthlyEnterprise" />
<RemoveMSI />
<AppSettings>
<Setup Name="Company" Value="DC Advisory" />
<User Key="software\microsoft\office\16.0\common\general" Name="shownfirstrunoptin" Value="1" Type="REG_DWORD" App="office16" Id="L_DisableOptinWizard" />
<User Key="software\microsoft\office\16.0\excel\options" Name="defaultformat" Value="51" Type="REG_DWORD" App="excel16" Id="L_SaveExcelfilesas" />
<User Key="software\microsoft\office\16.0\powerpoint\options" Name="defaultformat" Value="27" Type="REG_DWORD" App="ppt16" Id="L_SavePowerPointfilesas" />
<User Key="software\microsoft\office\16.0\word\options" Name="defaultformat" Value="" Type="REG_SZ" App="word16" Id="L_SaveWordfilesas" />
</AppSettings>
<Display Level="None" AcceptEULA="TRUE" />
</Configuration>
The important entries of “no display” and the “Extended User Licence Agreement” having been accepted are important, as GPO deployment works as a system service and so cannot display anything to the screen. Also see http://technet.microsoft.com/en-us/library/jj219426(v=office.15).aspx for the XML reference file for other settings you can contain here such as updates from the Internet (UpdatePath=””) or no updates (Updates Enabled=”FALSE”), the Channel value names and multiple languages (add more <Language ID=”xx-xx” /> nodes to the file) or to match the language to the OS (MatchOS, with Fallback language and allowing internet download if the language is not available with AllowCdnFallback), etc.
Download the Office ProPlus Click to Run Binaries
Download the Office Deployment Tool from http://www.microsoft.com/en-us/download/details.aspx?id=49117 and if you downloaded this a few months ago, download it again as it changes frequently and improves the setup process.
Install this software to get setup.exe and some example XML files. Copy setup.exe to \\server\Software\OfficeProPlus.
Run \\server\Software\Office365ProPlus\setup.exe /download \\server\Software\Office365ProPlus\config.xml to download the latest version (or the specified version if you have added Version=”15.1.2.3″ to config.xml where 15.1.2.3 is the build number you want to install). This will create the Office\Data folder in the \\server\Office365ProPlus share and download the binaries and any languages specified in the XML to that location โ do not modify the folder structure as the Office Deployment Tool will expect this structure to find the files under during installation.
Create A CMD File To Script The Install
In Notepad create a cmd file and save it to <strong\\server\Office365ProPlus as well. It will eventually go in the GPO folder location, but this will be your master copy. The cmd file will look like the following and for this demo is called _InstallOffice365ProPlusGPO.cmd
setlocal REM ********************************************************************* REM Environment customization begins here. Modify variables below. REM ********************************************************************* REM Set DeployServer to a network-accessible location containing the Office source files. set DeployServer=\\server\Software\Office365ProPlus REM Set ConfigFile to the configuration file to be used for deployment (required) set ConfigFile=\\server\Software\Office365ProPlus\config.xml REM Set LogLocation to a central directory to collect script log files (install log files are set in XML file). set LogLocation=\\server\InstallLogs\Office365ProPlus REM ********************************************************************* REM Deployment code begins here. Do not modify anything below this line (check quotes are quotes though). REM ********************************************************************* IF NOT "%ProgramFiles(x86)%"=="" (goto ARP64) else (goto ARP86) REM Operating system is X64. Check for 32 bit Office in emulated Wow6432 registry key :ARP64 reg query HKLM\SOFTWARE\WOW6432NODE\Microsoft\Office\16.0\ClickToRunStore\Packages\{9AC08E99-230B-47e8-9721-4577B7F124EA} if NOT %errorlevel%==1 (goto End) REM Check for 32 and 64 bit versions of Office 2013 in regular registry key.(Office 64bit would also appear here on a 64bit OS) :ARP86 reg query HKLM\SOFTWARE\Microsoft\Office\16.0\ClickToRunStore\Packages\{9AC08E99-230B-47e8-9721-4577B7F124EA} if %errorlevel%==1 (goto DeployOffice) else (goto End) REM If 1 returned, the product was not found. Run setup here. :DeployOffice echo %date% %time% Setup started. &amp;amp;gt;&amp;amp;gt; %LogLocation%\%computername%.txt pushd "%DeployServer%" start /wait setup.exe /configure "%ConfigFile%" echo %date% %time% Setup ended with error code %errorlevel%. &amp;amp;gt;&amp;amp;gt; %LogLocation%\%computername%.txt REM If 0 or other was returned, the product was found or another error occurred. Do nothing. :End Endlocal
This will be run by GPO and at computer startup look for the Click To Run registry key that indicates Office has been installed. If not found for 64 or 32 bit OSโs and 64 or 32 bit installations of Office then it will deploy office.
Create A Group Policy Object
Create in your domain a GPO object over an OU that contains the computers you want to install Office 2016 click to run on. This will run on all computers in this OU, so start with a test OU containing one or a few computers or use permissions to lock the GPO object down to specific computer accounts.
In this GPO set the following:
- A startup script that runs _InstallOffice365ProPlusGPO.cmd. A startup script will have a folder the script is located in (click Show Files button in the GPO editor) and copy the above cmd file from the Office deployment share to this folder.
- Then click Add and select the file โ there are no script parameters.
- Your GPO object will look like this.
- In Adminstrative Templates/System/Scripts set the Maximum wait time for Group Policy scripts to 1800 seconds. This is 30 minutes. The default is 10 minutes (600 seconds) but I have found Office installs take just over ten minutes on a LAN and longer if the fileshare is remote to the client computer. The script will be cancelled if it takes over 30 minutes, so you may need a higher value for your network.
Deploy Office 365 ProPlus Click to Run Click To Run
Run gpupdate /force on a test computer that is under the scope of your GPO object and then reboot the computer. The installation will start automatically and Office will be ready to use a few minutes after reboot. Office takes about 10 minutes to fully install on a LAN but can be used about 2 or 3 minutes after installation starts. Though in my lab with a low resourced file server it took 30 minutes to install. Do not reboot the PC in that time.
Check \\server\InstallLogs\Office365ProPlus for a file named after the computer. This will have two lines, one for the start of the deployment and one at the end (with โSetup ended with error code 0โ if successful).
Leave a Reply