Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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.
[….]

↑ Back to the top


Cause

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

↑ Back to the top


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.

↑ Back to the top


Resolution

↑ Back to the top


Status

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

↑ Back to the top


Keywords: kb, kbfix, kbexpertiseinter, kbqfe, kbsurveynew

↑ Back to the top

Article Info
Article ID : 3105389
Revision : 2
Created on : 7/30/2020
Published on : 7/30/2020
Exists online : False
Views : 737