Shared Script Library
GitHubLinkedInSponsor
  • Overview
  • Software
    • Installers
      • Bluebeam Revu
      • Browser Extension
      • Google Chrome
      • Microsoft Defender for Endpoint
      • Microsoft Office
      • Microsoft Teams
      • QuickBooks Desktop
    • Uninstallers
      • Browser Extension
  • Device Management
    • Backups
      • SQL Databases
      • Synology Active Backup
      • Windows Restore Point
    • Updates
      • Dell Command Update
      • Microsoft Office
      • Microsoft Store Applications
      • Windows Management Framework
      • Windows Updates
    • Misc
      • Reset Local Group Policy
Powered by GitBook
On this page
  • Overview
  • Script
  • Examples
  • Parameters

Was this helpful?

  1. Device Management
  2. Updates

Microsoft Office

PowerShell script to check for and install Microsoft Office application updates.

PreviousDell Command UpdateNextMicrosoft Store Applications

Last updated 7 months ago

Was this helpful?

Overview

Dev Insight: This script was extremely useful when patching for .

This script will check for ClickToRun installations of Microsoft Office. If found, OfficeC2RClient.exe will be used to scan for and apply updates. If updates are found, users may be asked to close Microsoft Office applications to complete update installation.

Prerequisites: This script has no prerequisites.


Script

Script will abort if no ClickToRun installations of Microsoft Office are detected.

Examples

.\UpdateOffice.ps1

This example checks for ClickToRun installations of Microsoft Office. If found, a Microsoft Office update scan will be initiated.


Parameters

This script has no parameters.

CVE-2020-23397
https://github.com/wise-io/scripts/blob/main/scripts/UpdateOffice.ps1
<#
  .SYNOPSIS
    Initiates Microsoft Office update scan
  .DESCRIPTION
    Initiates a scan for Microsoft Office updates using the ClickToRun client.
  .NOTES
    Author: Aaron J. Stevenson
#>

# Get path to ClickToRun executable
$Path = Resolve-Path "$env:SystemDrive\*\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe" -ErrorAction Ignore

if ($Path) {
  Write-Host "`nStarting Microsoft Office update process..."
  Start-Process -FilePath $Path -ArgumentList '/update user displaylevel=false' -Wait
}
else {
  Write-Host "`nNo ClickToRun installations of Microsoft Office detected."
}