WSMan-InvalidShellID error when you create remote PowerShell sessions in an Exchange Server 2013 environment

Symptoms

Consider the following scenario:

  • You deploy different cumulative updates for Microsoft Exchange servers in an Exchange Server 2013 environment.

  • You configure a load balancer that doesn't use session affinity for HTTP and a namespace for PowerShell.

  • You use the following Exchange Management Shell to create remote PowerShell sessions across the load balancer:

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://shell.contoso.com -AllowRedirection
    Import-PSSession $Session

In this scenario, the connection isn't successful. Additionally, you receive a WSMan-InvalidShellID error that resembles the following:

New-PSSession : [shell.contoso.com] Processing data from remote server shell.contoso.com failed with the following error message: [ClientAccessServer=Server1,BackEndServer=Server.contoso.com, RequestId=IDNumber, TimeStamp=Date/Time] [FailureCategory=WSMan-InvalidShellID] The request for the Windows Remote Shell with ShellId ShellIDNumner failed because the shell was not found on the server.Possible causes are: the specified ShellId is incorrect or the shell no longer exists on the server. Provide the correct ShellId or create a new shell and retry the operation. For more information, see the bout_Remote_Troubleshooting Help topic.
[….]

Cause

This issue occurs because the remote PowerShell sessions aren't routed constantly to the same Mailbox server.

Workaround

To work around this issue, use one of the following methods:

  • Configure the load balancer to use session affinity or persistence.

  • Have the Exchange servers use the same cumulative update build in load balancing.

Resolution

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

Status

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

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×