Event ID 258 "Unable to determine the installed file" after you uninstall Windows PowerShell 2.0

Applies to: Exchange Server 2016 Enterprise EditionExchange Server 2016 Standard Edition

Symptoms


In a Microsoft Exchange Server 2016 environment, after you uninstall Windows PowerShell version 2.0 and install a later version of PowerShell instead, the Exchange Management Shell can't be opened successfully, and you receive the following error message:

New-PSSession: [ServerName] Processing data from remote server ServerName failed with
the following error message: [ClientAccessServer=ServerName,BackEndServer=ServerName,RequestId=RequestId,TimeStamp=DateTime]
[AuthZRequestId=AuthZRequestId][FailureCategory=AuthZ-SetupVersionInformationCorruptException]
Unable to determine the installed file version from the registry key
'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine'. For more information, see the
about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession -ConnectionURI "$connectionUri" -ConfigurationName Micr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
gTransportException
+ FullyQualifiedErrorId : IncorrectProtocolVersion,PSSessionOpenFailed

The following event log entry is also logged:

Log Name: Application
Source: MSExchange RBAC
Date: DateTime
Event ID: 258
Task Category: RBAC
Level: Error
Keywords: Classic
User: N/A
Computer: ComputerName
Description:
(Process 8820, PID w3wp.exe)"RemotePS Public API Func GetApplicationPrivateData throws Exception Microsoft.Exchange.Diagnostics.SetupVersionInformationCorruptException: Unable to determine the installed file version from the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine'.

Cause


This issue occurs because the registry path of the later version of PowerShell is changed.

Workaround


You can add the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine registry key back after you uninstall Windows PowerShell 2.0. The quickest way is to grab the registry file from the Microsoft TechNet Gallery: https://gallery.technet.microsoft.com/Exchange-2016-CU1-7c843cb0.

Resolution


To fix this issue, install Cumulative Update 9 for Exchange Server 2016 or a later cumulative update for Exchange Server 2016.

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

References


Learn about the terminology that Microsoft uses to describe software updates.