Skip to content
Menu

Install Microsoft 365 Apps (Office) With a Generated Configuration

Downloads the Office Deployment Tool from Microsoft, checks its signature, writes a configuration from your inputs, installs Microsoft 365 Apps and verifies it is installed.

Install Microsoft 365 Apps (Office) with a generated configuration is free for members.

Enter your email to create your free account and get the file.

We'll email you the script and the weekly MSP Outpost email. Unsubscribe anytime. Privacy policy.

Already a member? Sign in.

Be the first to review Install Microsoft 365 Apps (Office) with a generated configuration. Tell other MSPs how it worked for you.

Write a Review

LanguagePowerShell
Runs onWindows 10 1809+, Windows 11, Windows Server 2019+; runs as SYSTEM
NeedsPowerShell 5.1, administrator rights, internet access to Microsoft, 8 GB free disk
Changes thingsChanges what it runs on

What It Does

The script downloads the Office Deployment Tool (setup.exe) from Microsoft's own address, refuses to run it unless its Authenticode signature is valid and belongs to Microsoft Corporation, and writes a configuration.xml from the inputs into a protected folder under ProgramData in the MSPOutpost folder. It runs setup.exe /configure, waits for it, then checks that Windows lists the product as installed. The setup tool and configuration are deleted afterwards, and the ODT's own log is kept.

It installs one Microsoft 365 product. It does not remove an older Office, does not sign anyone in or activate anything, and does not change an Office that is already there. If a Click-to-Run Office with the same Products value is installed, it ends OK without doing anything. If a different product is installed, it stops with an error and changes nothing. A leftover Windows Installer Office can make setup fail, so uninstall it first.

The install accepts the Office licence terms on the user's behalf, which is what an unattended Office install means, so run it only for people licensed to use the product. It needs about 8 GB free on the system drive and internet access to Microsoft, and typically takes 10 to 40 minutes, longer on a slow link, so raise TimeoutMinutes. A dry run only describes the install and downloads nothing.

Channel is Current, MonthlyEnterprise or SemiAnnual, with MonthlyEnterprise the default. Architecture Auto picks 64-bit, the native Arm64 build on an Arm PC, or 32-bit on a 32-bit PC. SharedComputerLicensing turns on shared computer activation for shared PCs and Remote Desktop servers.

Before You Run It

  • Make sure the people using the PC are licensed for the product you choose.
  • Uninstall any leftover Windows Installer (MSI) Office first.
  • Check the PC has about 8 GB free and can reach Microsoft's download addresses.
  • Run it with DryRun=true first. It describes the install and downloads nothing.

Type and Risk

  • Type: Action. It makes its change, checks the change worked and says what changed. It exits 0, or 2 when it could not do the job.
  • Risk: Low. Set DryRun=true, or run it with -WhatIf, to list every change without making any.
  • What it changes: Downloads the Office Deployment Tool and installs Microsoft 365 Apps.
  • Restart: It never restarts the machine itself. When a restart is needed to finish, the answer says so.
  • Typical run: 10 to 60 minutes.
  • Example answer: "Installed Microsoft 365 Apps O365BusinessRetail 16.0.19231.20154 (x64, MonthlyEnterprise)"
  • Tested before listing on Windows 11 with Windows PowerShell 5.1, run as SYSTEM, against its own test cases.

Inputs

Pass an input as an argument (-Name value), as an environment variable with the same name, which is how most RMMs pass script variables, or change its default in the param() block at the top of the script. An argument wins over an environment variable, which wins over the default.

  • Channel: Update channel: Current, MonthlyEnterprise or SemiAnnual. Default MonthlyEnterprise (the monthly, predictable one for managed PCs).
  • Architecture: Auto (default), x64, x86 or arm64. Auto installs the 64-bit edition on a 64-bit Windows PC (the native Arm64 build on an Arm PC) and 32-bit on a 32-bit one. arm64 is accepted only on an Arm64 PC and x64 only on an x64 PC; x86 works anywhere.
  • Products: O365BusinessRetail (Microsoft 365 Apps for business, default) or O365ProPlusRetail (Microsoft 365 Apps for enterprise).
  • ExcludeApps: Apps to leave out, a list separated by comma or semicolon, from: Access, Bing, Excel, Groove, Lync, OneDrive, OneNote, Outlook, OutlookForWindows, PowerPoint, Publisher, Teams, Word. Groove is the old OneDrive for Business sync app and Lync is Skype for Business. Default Groove,Lync. None means exclude nothing.
  • Language: MatchOS (default: the Windows display language) or a culture such as en-us, fr-ca or de-de.
  • SharedComputerLicensing: true turns on shared computer activation, for shared PCs and Remote Desktop servers. Default false.
  • TimeoutMinutes: How long to wait for setup.exe. Whole number, 10 to 240. Default 60.

Every script also takes DryRun, OutputFormat (Text, Answer, Json or Csv), ExportPath and ResultField, which writes the answer to an RMM custom field.

License

Provided "as is" under the MIT License, without warranty of any kind. Test before production use. MSP Outpost and User First Digital Inc. accept no liability for any damage or loss.

The Script

install-microsoft-365-apps.ps1 · 1033 lines · 54.4 KB

Free for Members

Create a free account or sign in to read, copy and download this script.

Welcome Back

Sign in to your MSP Outpost account.