powershell app deployment toolkit


There are currently many organizations migrating from previous versions of Microsoft Office to Microsoft Office 365 ProPlus. My favorite way to deploy Office 365 is by leveraging the excellent Powershell App Deployment Toolkit.

Many of these organizations are also spread around the globe with different language requirements.

I have seen that deploing Microsoft Office 365 ProPlus in large enterprise environment is not as trivial as you might think, as you have to take many things in to consideration.

The way described in this blog post is the way I go about deploying Office 365 ProPlus, and I have frankly not found a better way to do it.

If you have improvements to the process or any other ideas on how to do this better, please drop a comment 🙂


Since I can not go in to too much detail in this blog post, I have to make some assumptions:

  • Experience with deploying Applications in Configuration Manager Current Branch


The Office 365 ProPlus deployment solution in short:

  • Based on Powershell Application Deployment Toolkit 3.6.9
  • Uninstalls previous versions of Microsoft Office 2007-2016
  • Installs the Microsoft Office 365 ProPlus language according to the OS language culture
  • Displays pop-up asking the user to close Microsoft applications if they are open


In order to completely remove an old installation, I use Offscrub, which is a script provided by Microsoft. These scripts have been around since Microsoft Office 2007 and are also available for Microsoft Office 365 ProPlus.

The solution supports removal of Microsoft Office 2007-2016.

Powershell App Deployment Toolkit

Note that you might want to modify the section depending on what you want to remove. In my case I’m running CLIENTALL. I have noticed that this can sometimes remove more than you intended, so make sure to test it out before rolling out in to production.

*Update 2018-12-21*

Microsoft will be deprecating the Offscrub scripts in favor of the feature set in the new Office Customization Toolkit available at config.office.com.


This Microsoft Office 365 ProPlus deployment solution will analyze the computer’s OS culture and then apply an XML configuration file, depending on the outcome.

powershell app deployment toolkit

In the default version of the solution I only have English and Swedish defined, but you can select other languages.

If the OS language does not match any language in the list, it will automatically fall back to en-us.



Download the Microsoft Office 365 ProPlus solution.

powershell app deployment toolkit

Once downloaded, you should have the below files:

A description of the different files:

  • Deploy-Application.exe – Executable used for triggering the Deploy-Application.ps1 file.
  • Psexec/Psexec64.exe – Required for user interaction on Windows 7 32-bit due to session 0.
  • ServiceUI_x64/x86.exe – Required for user interaction under session 0.
  • Invoke-Installation.ps1 – Wrapper script to trigger the installation.


Session 0 is basically a non-interactive mode, where all user interaction will be blocked. This means that user prompts will not be displayed.

This happens in the following scenarios:

  • Installation during a Task Sequence.
  • A Required deployment with the User Experience setting configured to install Whether or not a user is logged on.

The solution to this problem is running ServiceUI.exe to bring the client out of session 0 and display the prompt. SeviceUI.exe is part of the Microsoft Deployment Toolkit and has been extracted for this purpose.
The Invoke-Installation.ps1 script will dynamically handle session 0.


Before you start to creating the application, you will need to make some customizations. These include:

  • Modify download XML
  • Create configuration XML files
  • Modify Deploy-Application.ps1
    • Change Offscrub behavior
    • Configure different locales
  • Change the banner
  • Make customizations to Powershell Application Deployment Toolkit


In order to download the Office files, we need to create an XML file. Name it to download.xml or similar.

The contents should be something like this:

<Configuration> <Add SourcePath="D:\tempfiles\Microsoft Office 365 ProPlus\Files" OfficeClientEdition="32"> <Product ID="O365ProPlusRetail" > <Language ID="en-US" /> </Product> </Add> </Configuration>

If you want to download more Languages, just copy the <Language ID=”en-US”>/> and replace it with you language of choice.Copy the setup.exe as well as the XML to the Files folder of the solution


In order to deploy Microsoft Office 365 ProPlus, we will need to have a configuration XML file for each language

I have named the XML file for the English installation install_en-us.xml and the Swedish install_sv-se.xml.

You can create an XML file using this online tool: https://officedev.github.io/Office-IT-Pro-Deployment-Scripts/XmlEditor.html

Here is the example of the English version. Make the appropriate modifications for your organization:

<Add Channel="Deferred" OfficeClientEdition="32" OfficeMgmtCOM="TRUE"> <Product ID="O365ProPlusRetail"> <Language ID="en-US" /> <ExcludeApp ID="Groove" /> </Product> </Add> <Display AcceptEULA="TRUE" Level="None" /> <Logging Level="Standard" /> <Property Value="1" Name="AUTOACTIVATE" /> <Property Value="FALSE" Name="FORCEAPPSHUTDOWN" /> <Property Value="0" Name="SharedComputerLicensing" /> <Property Value="FALSE" Name="PinIconsToTaskbar" /> <Updates Enabled="FALSE" /> </Configuration>


Modify the below XML file to fit your needs. If you want to uninstall several languages, you will need to copy the Language ID line and add the new language there.

<Configuration> <Display Level="None" AcceptEULA="True" /> <Property Name="FORCEAPPSHUTDOWN" Value="False" /> <Remove>     <Product ID="O365ProPlusRetail">             <Language ID="en-us" />     </Product>   </Remove> </Configuration>


Now you need to modify the script file Deploy-Application.ps1 to use the XML files that you have created.

powershell app deployment toolkit

Add the language code under
$LanguageMappingHT, in addition to the XML file for that language. Refer to this page for a full list of language codes.


Replace AppDeployToolkitBanner.png in the AppDeployToolkit folder with your own.


Refer to AppDeployToolkitConfig.xml in the AppDeployToolkit folder


Download the Office 2016 Deployment Tool: https://www.microsoft.com/en-us/download/details.aspx?id=49117

Place the setup.exe file under /Files/.


Launch an administrative command prompt and browse to /Files/

Execute the below command:

setup.exe /download download.xml
powershell app deployment toolkit

Due to the size (a few GBs), this might take a little while. Grab a coffee in the meantime.

When the download is complete you should have a folder called Office. Make sure to place this under Files in the solution directory.

powershell app deployment toolkit

If you browse to Files\Office\Data you can see the build version, which can be useful to know when deploying different Update Channels. Go to https://docs.microsoft.com/en-us/officeupdates/update-history-office365-proplus-by-date for a full list of build numbers for Office 365 ProPlus.

office 365 deployment

Now everything is in place and you need to create the application in Configuration Manager.



Create a new application via the Application Management pane.

office 365 deployment

Select Manually specify the application information.

If required, specify information for the Application Catalog/Software Center.


Press Add to create a new Deployment Type.

Select Manually specify the development type information. Make sure to select Script Installer above. If the default MSI option selected, it will impact selections you can later make.

Give the Deployment Type a name and press Next.

office 365 deployment


Configure according to the below table:

Content locationProvide a UNC path to the Office 365 ProPlus source files
Installation programInvoke-Installation.ps1
Uninstall programDeploy-Application.exe -DeploymentType "Uninstall"
office 365 deployment


Press Add Clause.

Setting TypeRegistry
KeySoftware\Microsoft\Windows\CurrentVersion\Uninstall\O365ProPlusRetail – en-us
Use (Default) registry key value for detectionChecked
Data TypeString

Now you have added the Detection Rule for English.

If you are including more languages in your deployment you will need to create a new Clause for each language and use an OR statement.

The installation will return a failed exit code if you do not configure this as the application will not be detected by Configuration Manager.

office 365 deployment


Installation behaviorInstall for system
Logon requirementWhether or not a user is logged on
Installation program visibilityNormal
office 365 deployment

Press Next, Next and review the Summary.

office 365 deployment

Press Next to finalize the creation of the Deployment Type.

Press Next again to finalize the creation of the application.

Distribute content

Distribute the content to your Distribution Points.

Deploy to user/device collection

Deploy to collections.



Following deployment of the application, run a Policy Refresh on the client in order for it to appear in Software Center.

office 365 deployment

Press the icon and press Install in the next window.

office 365 deployment

If you have Microsoft Office applications open, you will see this:

powershell app deployment toolkit

If you don’t have any Microsoft Office applications open, you will be prompted with this.

powershell app deployment toolkit

Upon continuing, previous Microsoft Office versions will automatically be uninstalled.

powershell app deployment toolkit

Following the uninstallation, the installation of Microsoft Office 365 ProPlus will be started.

powershell app deployment toolkit


Log file location: C:\Windows\Logs\Software\Microsoft_Office365ProPlus_EN_01_PSAppDeployToolkit_Install


The Powershell Application Deployment Toolkit is an excellent tool to build upon when creating solutions such as deployment of Microsoft Office 365 ProPlus.
I hope that I have provided you with some help for your deployment project.
It definitely took me some time to figures some of these things out.
If you have any comments or feedback, please drop a comment below.