Behind the Scenes with Click to Run
When you install the click to run version of Office (now Microsoft 365 Apps for Enterprise) on a PC, the installation updates several settings in the system registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration. Among the settings are:
- O365ProPlusRetail.EmailAddress: The User Principal Name of the account used to install the software.
- TenantId: The GUID for the tenant.
- VersionToReport: The version of the software installed on the PC. For example, 16.0.10827.20138.
Using PowerShell to Read the System Registry
Some administrators use PowerShell to read these values from the system registry and send the data to a central location for reporting purposes. For example, to see the complete set of values for the click-to-run configuration, use the command:
Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration VersionToReport : 16.0.10827.20138 ClientFolder : C:\Program Files\Common Files\Microsoft Shared\ClickToRun ClientVersionToReport : 16.0.10827.20138 WatcherInterval : 3600000 PipelineServerName : ClickToRun_Pipeline16 PackageLockerPath : C:\ProgramData\Microsoft\Office ScenarioCulture : InstallID : C5FCDC94-269E-4D32-8A2B-19665F51837A Platform : x86 InstallationPath : C:\Program Files (x86)\Microsoft Office ClientCulture : en-us CDNBaseUrl : http://officecdn.microsoft.com/pr/64256afe-f5d9-4f86-8936-88 40a6a4f5be AudienceId : 64256afe-f5d9-4f86-8936-8840a6a4f5be AudienceData : Insiders::CC O365ProPlusRetail.MediaType : CDN UpdatesEnabled : True O365ProPlusRetail.ExcludedApps : groove StreamingFinished : True ProductReleaseIds : O365ProPlusRetail RSODReset : False O365ProPlusRetail.OSPPReady : 1 UpdateChannel : http://officecdn.microsoft.com/PR/64256afe-f5d9-4f86-8936-88 40a6a4f5be UpdateChannelChanged : False O365ProPlusRetail.TenantId : 4,b662313f-14fc-43a2-9a7a-d2e27f4f3478 O365ProPlusRetail.EmailAddress : Tony.Redmond@redmondassociates.org BackgroundTransportMethodDefault : cachedhttp BackgroundTransportMethodFailures : 0 OneDriveClientAddon : INSTALLED PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTW ARE\Microsoft\Office\ClickToRun\Configuration PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTW ARE\Microsoft\Office\ClickToRun PSChildName : Configuration PSDrive : HKLM PSProvider : Microsoft.PowerShell.Core\Registry
To retrieve the value of an individual key, use:
(Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration -Name "VersionToReport").VersionToReport 16.0.10827.20138
Or (as noted by Pat Richard):
Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration" -Name "VersionToReport"
What you do with the value is entirely up to you!
This information comes from Chapter 10 of the Office 365 for IT Pros eBook. It’s the kind of tip that we find interesting. We hope that you do too.
As long as you’re using PowerShell 5.0 or later, we can shorten this to
Get-ItemPropertyValue -Path ‘HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration’ -Name ‘VersionToReport’
Thanks Pat…
How do I find these values if I’m running powershell from a windows service as localsystem? I can access them fine from powershell running myself, but when the script runs in windows service as localsystem it acts like the values aren’t there.
No idea. Blogs like http://woshub.com/how-to-access-and-manage-windows-registry-with-powershell/ seem to confirm that the PowerShell registry provider works under the context of a logged-in user. I suspect that this is the case. Time for some searching…