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.
Go to actions and click on “New…”
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.
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
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.
One thought to “Auto Update M365 Apps installation package in MEMCM with PowerShell”