Automatically Trigger Office 365 Updates via Command Line Without Launching Applications


24 views

When deploying Office 365 in enterprise environments, we often need to ensure applications are fully updated before users first launch them. The standard update method (File > Account > Update Options) triggers activation prompts, which isn't ideal for mass deployments.

Microsoft provides several update channels for Office 365:

  • Click-to-Run update service (runs automatically in background)
  • Office Deployment Tool (ODT)
  • Group Policy updates

The most reliable method is using the Office Deployment Tool's configuration.xml:

<Configuration>
  <Updates Enabled="TRUE" 
           UpdatePath="\\server\updates" 
           Deadline="2023-12-31T23:59:59Z"/>
  <Display Level="None" AcceptEULA="TRUE" />
</Configuration>

Then execute the update with:

setup.exe /configure configuration.xml

For environments where ODT isn't available, use PowerShell to trigger the update service:

$OfficeUpdate = New-Object -ComObject "Microsoft.Update.SystemInfo"
$UpdateSession = New-Object -ComObject "Microsoft.Update.Session"
$UpdateSearcher = $UpdateSession.CreateUpdateSearcher()
$SearchResult = $UpdateSearcher.Search("IsInstalled=0 and Type='Software'")
$UpdatesToInstall = New-Object -ComObject "Microsoft.Update.UpdateColl"
foreach ($Update in $SearchResult.Updates) {
    if ($Update.Title -match "Office 365") {
        $UpdatesToInstall.Add($Update) | Out-Null
    }
}
if ($UpdatesToInstall.Count -gt 0) {
    $Installer = $UpdateSession.CreateUpdateInstaller()
    $Installer.Updates = $UpdatesToInstall
    $InstallationResult = $Installer.Install()
}

Create a scheduled task to run the Office Click-to-Run update executable:

schtasks /create /tn "Office365Update" /tr "C:\Program Files\Common Files\microsoft shared\ClickToRun\OfficeC2RClient.exe /update user" /sc weekly /d MON /st 03:00
  • Network bandwidth - large updates may impact network performance
  • Update sources - specify internal WSUS server if available
  • Timing - avoid business hours for update deployment
  • Logging - always implement update verification and logging

Common error codes and solutions:

30088-4:    Insufficient disk space
30182-101: Network connectivity issues
30183-39:  Corrupt installation

Check update logs at:

%windir%\Temp\OfficeSetup\*.log

When deploying Office 365 in enterprise environments, we often need to update the installation before user sign-in to ensure all security patches are applied. The standard update process through Office UI triggers the 30-day activation countdown prematurely.

Here's the most reliable method I've found for O365 ProPlus deployments:


# Run as Administrator
$OfficeUpdatePath = "C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe"
Start-Process -FilePath $OfficeUpdatePath -ArgumentList "/update user"

For different Office versions or deployment scenarios:

SCANPSTATE Method (Older Versions)


"C:\Program Files\Microsoft Office 15\ClientX64\OfficeC2RClient.exe" /update user

Scheduled Task Approach

Create a scheduled task that runs this command with highest privileges:


schtasks /create /tn "Office Silent Update" /tr "'C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe' /update user" /sc weekly /ru SYSTEM

Check update results in Event Viewer:


Get-WinEvent -FilterHashtable @{LogName='Application'; ProviderName='Office ClickToRun'; ID=300}

For detailed logging, add these parameters:


/update user updatepromptuser=false forceappshutdown=true displaylevel=false

When using Configuration Manager or Intune, configure these settings in your XML:


<Updates Enabled="TRUE" UpdatePath="\\server\updates" />
<Display Level="None" AcceptEULA="TRUE" />
  • Ensure network service has access to Microsoft update servers
  • Check disk space requirements (5GB free minimum)
  • Verify no pending reboots before updating
  • Use Process Monitor to debug permission issues