Monitoring with PowerShell: Monitoring Office C2R updates

This blog might be a little shorter than normally, I’ve been a bit swamped with work so if you have any questions, let me know!

This time we’re going to monitor the update status of Microsoft Office that’s been installed using C2R. C2R installers do not get updates from the Microsoft Update services and thus RMM systems often can’t update these. Seeing as C2R is now the standard for all Office Installations we’ll need to start monitoring this separately from Windows Updates. We also want all our of clients to be in the same update channel.

$ReportedVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration" -Name "VersionToReport"
$Channel = (Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration" -Name "CDNBaseUrl") -split "/" | Select-Object -Last 1

If (!$Channel) { 
    $Channel = "Non-C2R version or No Channel selected."
}
else {
    switch ($Channel) { 
        "492350f6-3a01-4f97-b9c0-c7c6ddf67d60"  { $Channel = 'Current ("Monthly")' }
        "64256afe-f5d9-4f86-8936-8840a6a4f5be"  { $Channel = "Current Preview (`"Monthly Targeted`"/`"Insiders`")" }
        "7ffbc6bf-bc32-4f92-8982-f9dd17fd3114"  { $Channel = "Semi-Annual Enterprise (`"Broad`")" }
        "b8f9b850-328d-4355-9145-c59439a0c4cf"  { $Channel = "Semi-Annual Enterprise Preview (`"Targeted`")" }
        "55336b82-a18d-4dd6-b5f6-9e5095c314a6"  { $Channel = "Monthly Enterprise" }
        "5440fd1f-7ecb-4221-8110-145efaa6372f"  { $Channel = "Beta" }
        "f2e724c1-748f-4b47-8fb8-8e0d210e9208"  { $Channel = "LTSC" }
        "2e148de9-61c8-4051-b103-4af54baffbb4"  { $Channel = "LTSC Preview" }
    }
}

To monitor on the versions we want to support by checking this page by Microsoft. We also monitor the Channel by alerting on anything that is not “Monthly Channel”, as soon as we see an agent that has the incorrect channel we fix it by running the following command

"C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe" /changesetting Channel=Monthly

When a client is not up to date, we force the latest update via the following command, this updates the client specifically to the version we want.

 "C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe"  /update USER displaylevel=False updatetoversion=16.0.7341.2029

If you want to update to any update that is available, for the channel the installation is in.

 "C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe"  /update USER displaylevel=False

And that’s it! you can now use this to update to the latest versions, and monitor the minimum required version you need installed. As always, Happy PowerShelling!

Update: Updated as Microsoft changed the channel names, one of my friends had an updated version of the version table for me so I added that. 🙂

6 Comments

  1. copenhaus October 29, 2020 at 4:57 pm

    Hi, it’s weird that it’s complaining about “else” in your script.

    If I changed it to look like:

    } else { (instead of a new line)

    then the script works without errors.

    Thanks.

  2. copenhaus October 29, 2020 at 6:17 pm

    Hi, do you know how to change the UPDATEPATH??

    Our deployment was through an internal UNC share…that’s all fine until everyone works from home and can’t reach the internal UNC share…I’d like to change it to office MS LTSC path.

    Thanks for your advice in advance.

  3. IT December 9, 2020 at 5:49 pm

    This is really useful, is there any chance the channels could be updated to reflect the new channel names from MS, such as Monthly Enterprise?

  4. Prejay February 23, 2021 at 1:57 pm

    Here’s the up to dat4e listings based on https://docs.microsoft.com/en-us/DeployOffice/update-channels-changes

    “http://officecdn.microsoft.com/pr/55336b82-a18d-4dd6-b5f6-9e5095c314a6” {$Channel = “Monthly Enterprise Channel”}
    “http://officecdn.microsoft.com/pr/492350f6-3a01-4f97-b9c0-c7c6ddf67d60” {$Channel = “Current Channel”}
    “http://officecdn.microsoft.com/pr/64256afe-f5d9-4f86-8936-8840a6a4f5be” {$Channel = “Current Channel (Preview)”}
    “http://officecdn.microsoft.com/pr/7ffbc6bf-bc32-4f92-8982-f9dd17fd3114” {$Channel = “Semi-Annual Enterprise Channel”}
    “http://officecdn.microsoft.com/pr/b8f9b850-328d-4355-9145-c59439a0c4cf” {$Channel = “Semi-Annual Enterprise Channel (Preview)”}
    “http://officecdn.microsoft.com/pr/5440fd1f-7ecb-4221-8110-145efaa6372f” {$Channel = “Beta Channel”}

Leave a comment

Your email address will not be published. Required fields are marked *

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