Force Microsoft Office Updates
Use this script to update Microsoft 365 desktop apps.
On this blog
Prerequisites
Solution
On this blog
On this page we talk about a scenario where Microsoft 365 desktop apps must be updated as soon as possible. Since the software is already installed on the device, you only need to trigger the update processes.
Prerequisites
Microsoft 365 Apps are installed on the device. I used Microsoft Intune to install Microsoft 365 desktop apps with app type Microsoft 365 Apps for Windows 10 and later, but this solution works with other installation options as well. Microsoft Intune is used to deploy a powershell script.
Solution
In this solution we focus on the update trigger. We create a basic script and use remediation scripts in Intune to schedule and monitor the update process.
Create a PS1 script file with these two lines below. In this example the Office click to run client will start with user context. It will update all files necessarily and to show a notification to the user if needed.
ForceOfficeUpdates.ps1
cd "C:\Program Files\Common Files\Microsoft Shared\ClickToRun"
.\OfficeC2RClient.exe /update user
Now we use the remediation script in Microsoft Intune to schedule the installation with run once. (We keep the script after it runned, because it allows us the schedule it again the next time.)
Go to: Microsoft Intune > Devices > Scripts and remediations
And follow the instructions below:
- Create
- 1 Basics: Provide a name and description
- 2 Settings:
- Detection script file: upload your ps1 script
- Remediation script: none
- Run this script using the logged-on credentials: Yes
- Enforce script signature check: No
- Run script in 64-bit PowerShell: Yes
- 3 Scope tags: As per your scenario.
- 4 Assignments: Use a device group with your managed devices.
- After the selection. Click ‘daily’ in the schedule column.
- Change the frequency to: Once
- Time: choose now
- Runs on: today
- Check the time zone
- Apply > Next
-
- Review and create
Now you have a script that will run when the device checks in to Intune.
Notes
Because of the schedule to run once:
When a managed device is turned off and will be switched on after three months: it will run.
When a new device is enrolled: it will run.