MSEndpointMgr

Schedule content update for an Office 365 ProPlus application in ConfigMgr

When using ConfigMgr to create an Office 365 installer, essentially an application used to install, configure or even upgrade existing Office applications to e.g. Office 365 ProPlus, it’s a good idea to keep the content of the application updated on a regular basis. Today, there’s no built-in mechanism in ConfigMgr that gives you the option to for instance perform a somewhat similar process as you have with operating system images where you can do offline servicing, for keeping the content updated to the latest version of the selected update channel for the Office 365 installer application.

A little bit of background

Let’s go over why the topic of this blog post is in fact necessary and for what reasons. In ConfigMgr today, the Office Customization Tool are now integrated into the wizard when you select to create an Office 365 installer application, which is a great addition and makes it all a lot easier to get started. The integration is shown almost directly in the wizard, as shown in the image below, after you’ve given the installer application a name and specified where to locate the associated content.

With the current way this has been implemented in ConfigMgr, you go through the different stages of the Office Customization Tool and you at some point have to select a specific version of the specified Office suite. When selecting the Office suite version (e.g. for the Office 365 ProPlus suite), you have the option of selecting only a set of targeted versions, that usually presents about 15 various versions ranging from the latest currently being available to some versions back that are currently in support.

If you were to use the Office Customization Tool instead directly through a web browser, by going to config.office.com, you’re given a choice to select Latest as the version.

By having the option to select Latest version, simply means that you’ll not have any downloaded content available for when distributing your Office application. The web version of Office Customization Tool gives you the option to create the required XML to distribute your desired Office suite application using various methods, e.g. with Intune, where the content would be downloaded during installation from the Office CDN. In ConfigMgr, the approach is a bit different where the Office Customization Tool doesn’t allow you to select the Latest version. This is by design since the wizard driven configuration for an Office 365 installer application downloads the content of the selected version and puts that in the content source location that you’ve provided.

So to sum up, the final configuration.xml file that will be in the provided content source location together with setup.exe for your Office 365 installer application, will contain the Version attribute with what you selected in the Office Customization Tool in addition to the content for this version. This essentially means that the content of this Office 365 installer application will always be the same, and when time goes on it’ll eventually install an older and older version of the selected update channel.

Making sure the content is up-to-date

Like I’ve already stated, currently as of writing this blog post, there’s no built-in functionality to help us with this issue. Also, for some it might not be a great idea to not have the content included in the application and relying on it coming from the Office CDN, for various reasons. To work around this, I’ve created a PowerShell script that performs the following actions:

  • Download and extract the latest Office Deployment Tool to ensure future usage
  • Replace the currently Office Deployment Tool only if newer
  • Check for existing version of Office 365 suite application content
  • Invoke Office Deployment Tool with embedded configuration file in download mode
  • Remove older Office 365 suite application content if necessary
  • (Optional) Update the detection method used in the application object with latest version details
  • Update Distribution Points associated with the Office 365 suite application

Download the script

Before explaining how the script should be used, grab it from our public GitHub repository below:

Invoke-OPPContentUpdate.ps1

Using the script

First things first, the ConfigurationManager module needs to be present where the the script is executed. The script can mainly be used for two different scenarios:

  • Update application content and the detection method
  • Update application content only

The reason for this is that the first scenario targets when the Office 365 installer application is only used during OSD, e.g. added in an Install Application step in a task sequence. If the application is also deployed as a Required application to users or devices, issues will occur once the detection method has been updated to check for the latest version of Office once the Application Deployment Evaluation cycle kicks in. Picture a scenario where you’ve the latest content for your application and the detection method was updated to reflect this, but you have an older version installed on a device that has not yet been updated. This would cause the deployment evaluation to determine it’s not installed and attempt to install Office again. Not a scenario that you’d want happening in your environment. You can control whether you want to update the detection method when the script runs or not by setting the SkipDetectionMethodUpdate to $true or $false. When SkipDetectionMethodUpdate is set to $false, the detection method will be updated but when set to $true it will be skipped.

Apart from the main two scenarios, the script requires you to configure the following parameters, either hard-coded in the script or passed as parameter values:

  • OfficePackagePath
    • Full path to the Office 365 installer application content source
  • OfficeApplicationName
    • Name of the Office 365 installer application
  • OfficeConfigurationFile
    • Name of the XML configuration file present in the root of the application content source

Using the script has been design to be as easy as possible, as all parameters are not required to be passed, rather being hard-coded values that you need to enter. By doing this, you can simply just call the script like below in a scheduled task based on the update frequency interval that makes sense in your environment:

.\Invoke-OPPContentUpdate.ps1

This is how the script looks when invoked for the first scenario, where it’d also update the detection method:

And this is how it looks when the detection method is not updated:

What if you have Visio or other suite products made available to be installed on top of an existing installation of Office 365 ProPlus? Assuming that you have a separate application to handle that in ConfigMgr, simply apply the same logic and scheduling using the script in this post and it will work it’s magic for you.

I hope this helps you with keeping the content updated and Office being deployed as the latest version available.

Nickolaj Andersen

Chief Technical Architect and Enterprise Mobility MVP since 2016. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows devices and deployments including automation. Awarded as PowerShell Hero in 2015 by the community for his script and tools contributions. Creator of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService to name a few. Frequent speaker at conferences such as Microsoft Ignite, NIC Conference and IT/Dev Connections including nordic user groups.

3 comments

    • Hi Alex,

      I’m uncertain what you mean by Office 2019 Click-2-Run. Do you mean the MSI-based version of Office 2019? Anyway, the script was developed for, what’s now called, Microsoft 365 Apps for Enterprise (previously Office 365 ProPlus Click-2-Run based). I can’t say for sure that it would work with the MSI-based setup.

      Regards,
      Nickolaj

  • I have multiple deployments in my package to allow the Workstation & Servers to use the same source package.

    The code assumes a single deployment so i’ve added in an additional for loop to work through all the deployments.

    # Update Distribution Points
    Write-Verbose -Message “Attempting to update Distribution Points for application: $($OfficeApplicationName)”
    foreach ($deployment in $OfficeDeploymentType.LocalizedDisplayName){
    Update-CMDistributionPoint -ApplicationName $OfficeApplicationName -DeploymentTypeName $deployment -ErrorAction Stop -Verbose:$false
    }

Sponsors

Categories

MSEndpointMgr.com use cookies to ensure that we give you the best experience on our website.