When deploying Microsoft Office 2021, one of the key considerations is how to handle older, existing versions like Office 2010. By default, the modern Office installer will automatically remove these older versions, but for automated or customized deployments, you need more control.

This guide will walk you through how I used the Office Deployment Tool (ODT) to create a silent, automated installation of Office 2021 that also cleanly removed any older Office versions.


Part 1: Understanding the Challenge (Click-to-Run vs. MSI)

The primary reason I can’t have Office 2010 and Office 2021 installed side-by-side is that they use different installer technologies:

  • Office 2010 uses the traditional MSI (Windows Installer) technology.
  • Office 2021 uses the modern Click-to-Run (C2R) technology.

Because these two technologies manage files, registry keys, and updates differently, they cannot coexist on the same machine. As a result, the Office 2021 installer is designed to remove older MSI-based versions to prevent conflicts.


Part 2: Introducing the Office Deployment Tool (ODT)

The Office Deployment Tool (ODT) is a command-line tool from Microsoft that gave me full control over my Office installation. With the ODT, I could define exactly what I wanted to install, how I wanted to install it, and what should be done with older versions, all through a simple configuration.xml file.

Where to get the ODT: I downloaded the ODT directly from the Microsoft Download Center.


Part 3: Creating the configuration.xml File

The configuration.xml file is the heart of the ODT. It tells the setup.exe executable what to do. Below is a recommended configuration for silently installing Office 2021 and automatically removing Office 2010.

I created a file named configuration.xml with the following content:

<Configuration>
  <Add OfficeClientEdition="64" Channel="PerpetualVL2021">
    <Product ID="ProPlus2021Volume">
      <Language ID="en-us" />
      <ExcludeApp ID="Groove" />
      <ExcludeApp ID="Lync" />
    </Product>
  </Add>

  <!-- This is the key element to remove old versions -->
  <RemoveMSI All="True" />

  <Display Level="None" AcceptEULA="TRUE" />
  <Property Name="AUTOACTIVATE" Value="1" />
  <Property Name="FORCEAPPSHUTDOWN" Value="TRUE" />
</Configuration>

Explanation of the XML Elements:

  • <Add OfficeClientEdition="64" ...>: Specifies that we are installing the 64-bit version of Office 2021 from the Volume Licensing channel.
  • <Product ID="ProPlus2021Volume">: Defines the product to be installed (Office Professional Plus 2021).
  • <ExcludeApp ...>: Allows me to exclude specific applications (like the old Groove and Lync) from the installation.
  • <RemoveMSI All="True" />: This is the most important part. It instructs the installer to automatically and silently remove any older MSI-based Office versions (like 2010, 2013, or 2016) before installing the new version.
  • <Display Level="None" ...>: This makes the installation completely silent. No user interface will be shown.
  • <Property Name="AUTOACTIVATE" Value="1" />: Automatically activates Office if I am using a volume license key (KMS or MAK).
  • <Property Name="FORCEAPPSHUTDOWN" Value="TRUE" />: If any Office applications (like Word or Excel) are open, the installer will force them to close.

Part 4: Running the Installation

Once I had downloaded the ODT (which includes setup.exe) and created my configuration.xml file in the same directory, I could start the installation.

I opened a Command Prompt or PowerShell terminal as Administrator, navigated to the directory containing my files, and ran:

setup.exe /configure configuration.xml

The installation will now run completely silently in the background. It will first remove Office 2010 and then install Office 2021 without any user interaction.


Part 5: Automating with PowerShell

I can wrap the entire process in a PowerShell script to make it fully automated. This script will check if Office 2021 is already installed and, if not, run the silent installation.

# Check if 64-bit Microsoft Office 2021 is already installed
$officeInstalled = Get-ItemProperty HKLM:\Software\Microsoft\Office\ClickToRun\Configuration -ErrorAction SilentlyContinue |
    Where-Object { $_.ProductReleaseIds -match "ProPlus2021Volume" -and $_.Platform -eq "x64" }

if ($officeInstalled) {
    Write-Host "Microsoft Office 2021 (64-bit) is already installed. Skipping installation." -ForegroundColor Green
} else {
    Write-Host "Office 2021 not detected. Starting silent installation..." -ForegroundColor Yellow
    
    # Ensure setup.exe and configuration.xml are in the same directory as the script
    $scriptPath = $PSScriptRoot
    $setupPath = Join-Path -Path $scriptPath -ChildPath "setup.exe"
    $configPath = Join-Path -Path $scriptPath -ChildPath "configuration.xml"

    if (Test-Path $setupPath -and Test-Path $configPath) {
        Start-Process -FilePath $setupPath -ArgumentList "/configure `"$configPath`"" -WindowStyle Hidden -Wait
        Write-Host "Installation complete!" -ForegroundColor Cyan
    } else {
        Write-Error "setup.exe or configuration.xml not found in the script directory."
    }
}

Next Steps: Fixing Activation Issues

After a successful installation, you might find that Office fails to activate in a restrictive corporate network. This is usually a firewall issue. For a complete guide on which ports and domains to open for Office activation, see our companion article:


Conclusion

The Office Deployment Tool provides a powerful and flexible way to automate the deployment of Office 2021. By using a well-crafted configuration.xml file, I could ensure a smooth, silent installation that automatically removed outdated versions like Office 2010, keeping my environment clean and up-to-date.

This method is ideal for IT administrators who need to deploy Office across multiple machines in a consistent and automated fashion.