Office installations made easy: Introducing OfficeDsc PowerShell module
Learn how you can easily automate Office installations using PowerShell DSC

If you've ever had to deploy Microsoft Office on multiple systems, you already know the struggle. Handling updates, excluding apps, and choosing the right channel, the process is rarely straightforward.
Traditional enterprise tooling requires some form of configuration to get started. But what if you want a repeatable, compliant, and automated way to install Office? That's precisely why I built the OfficeDsc module.
OfficeDsc is a PowerShell module containing class-based DSC resources for installing and configuring Office. Rather than wrestling with the available configuration options, you simply define the desired state once, and DSC ensures it stays that way.
In this blog post, you will learn why you can use DSC for Office and how you can get started.
Pre-requisites
The OfficeDsc module requires you to have:
- PowerShell 7.2+ installed.
- PSDesiredStateConfiguration v2.0.7.
Why DSC for Office
DSC is always built with compliance and repeatability in mind. With DSC, you:
- Define what the system should look like.
- Ensure that machines remain compliant.
- Gain consistency across multiple systems.
The Office Deployment Tool (ODT) requires you to define a configuration file (.xml
) with multiple options. While you can look up the documentation for each available element, OfficeDsc makes it easy for you to define it based on properties that are strongly validated.
Imagine you want to install the O365BusinessRetail version and receive SemiAnnual updates. Normally, you would run the following:
$configXml = @"
<Configuration>
<Add OfficeClientEdition="64" Channel="SemiAnnual">
<Product ID="O365BusinessRetail">
<Language ID="en-US" />
</Product>
</Add>
<Display Level="None" AcceptEULA="TRUE" />
</Configuration>
"@
$configPath = Join-Path $env:TEMP 'ODT_Install.xml'
Set-Content -Path $configPath -Value $configPath
& setup.exe /configure $configPath
With DSC, you can do it differently:
Invoke-DscResource -ModuleName OfficeDsc -Name Office365Installer -Method Set -Property @{
Path = 'C:\ODT\setup.exe'
ProductId = 'O365BusinessRetail'
Channel = 'SemiAnnual'
}
With this invocation, you've just told DSC:
- Install Office 365 Business Retail.
- Use the Semi Annual channel.
- Deploys the package with your system culture (the language).
- Automatically accepts the EULA.
No need to write a small script or babysit the installer. When you run DSC from an orchestrator, you get the benefit of compliance and easy automation across multiple systems.
Getting started
To get started with OfficeDsc, you can install the module from the PowerShell Gallery:
# Install from PowerShell Gallery
Install-PSResource -Name OfficeDsc -Repository PSGallery
You can list out the available DSC resources by running:
# Use PSDesiredStateConfiguration module
Get-DscResource -Module OfficeDsc
If you want to play right out of the box without using the PSDesiredStateConfiguration
module, you can instantiate a class and get IntelliSense on the available properties:
# Import classes and enumerations
using module OfficeDsc
# Instantiate class
$officeDsc = [Office365Installer]::new()
# Try to set a property
$officeDsc.ProductId = # Press tab here to hover through the available products
Get-Help
Unlike standard PowerShell cmdlets, class-based DSC resources don't have the default Get-Help
experience. To fill this gap, you can find documented examples and usage instructions on the GitHub repository. Here you can see the most up-to-date references.
If you're looking for alternative ways of managing Office installations using OfficeDsc, WinGet, and Microsoft DSC v3 are also options. For more information, check out the documentation at:
- Running OfficeDsc through WinGet
- Running OfficeDsc through Microsoft DSC v3
What's next
OfficeDsc is just getting started. The initial release focused on the default options, but the roadmap includes:
- Allow offline installation.
- Add
AppSettings
elements. - Support multiple Office versions.
If you would like me to prioritize these features, let me know. You can open an issue on the repository or reach out to me on social media.
Summary
Whilst OfficeDsc just got released, it brings the benefit of:
- Automatically install Office using a declarative DSC resource or invoke directly.
- Enforce compliance and drift-detection.
- Avoid the complexity of defining XML-based configuration files.
The module is still evolving, but it already provides a simple yet reliable way to manage Office installations. Give it a try and let me know how it works for you.