Microsoft 365 Apps

Auto Update M365 Apps installation package in MEMCM with PowerShell

How to auto update M365 Apps installation package in MEMCM with PowerShell and a scheduled task.

I wanted a process that would automatically update the installation package files for Microsoft 365 Apps on a schedule and then update the distribution points in Microsoft Endpoint Manager Configuration Manager (MEMCM). This would ensure that whenever an OSD task sequence ran, M365 apps / Office 365 would install using the latest version for the selected channel, and no updates where required once the task sequence was complete.

Check out my guide how to Install M365 Apps with MEMCM Installer – Step by Step

Now that we have a proper application to install Microsoft 365 Apps / Office 365 in MEMCM, the next step is to set up thee automation that always keeps it updated. I don’t want to deploy an outdated version of this and force users to install update it right after it is installed.

It was quite easy to achieve this. I created a PowerShell script that downloads the latest binaries for Microsoft 365 Apps into the source folder of the application. The script then connects to MEMCM using the built-in PowerShell module and updates the distribution points for the M365 application to ensure the content is updated on all distribution points that the application is distributed to.

You can download the PowerShell script from my GitHub repository: Update-M365AppsInstallationPackage.ps1

The next step is to configure a scheduled task that executes the Update-M365AppsInstallationPackage.ps1 PowerShell script on a schedule.

Configure the scheduled task to automate it.

Open scheduled tasks. Create a folder for MEMCM if you don’t have it already. Click on “Create Task…” and fill in the details from the picture below.

Auto Update M365 Apps  installation package in MEMCM with PowerShell 1

Go to actions and click on “New…”

Auto Update M365 Apps  installation package in MEMCM with PowerShell 2

Type in “PowerShell.exe” in Program/Script and. I entered the following as arguments:

-ExecutionPolicy Bypass -File "E:\Scripts\Update-M365AppsInstallationPackage.ps1" -Siteserver "MEMCM01.andersrodland.com" -Sitecode "AR1" -ApplicationName "M365 Apps for Enterprise" -Path "\\memcm01\source\Applications\Microsoft 365 Apps for Enterprise"

Note: ExecutionPolicy Bypass is only required if your execution policy prevents you from executing scripts and you don’t have access to a code signing certificate to sign the script.

Auto Update M365 Apps  installation package in MEMCM with PowerShell 3

Under schedule, define a schedule that works with you and the update channel you use.

This is how the scheduled task looks like when configured and executed successfully

Auto Update M365 Apps  installation package in MEMCM with PowerShell 4

Remember during testing to verify that the distributions points where successfully updated as well.

I hope my guide on how to auto update M365 Apps with MEMCM is of value to you.

Anders Rødland

Anders Rødland started his IT career in 2006. My main focus is MS Configuration Manager and client management, and I have passed 17 Microsoft certifications since then. My main expertise is on client management with Microsoft Endpoint Manager: Intune and Configuration Manager. I also do a lot of work on the security side with Microsoft Defender for Endpoint. In addition to my Microsoft certification, I also have an ITIL v3 Foundation certification.This is my private blog and do not represent my employer. I use this to share information that I find useful. Sharing is caring.

One thought to “Auto Update M365 Apps installation package in MEMCM with PowerShell”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.