The WinRM client cannot process the request

Syptoms:

Error message when you try to start Exchange 2013 Management Shell (EMS):

VERBOSE: Connecting to EX-LON01.contoso.com.
New-PSSession : [EX-LON01.contoso.com] Connecting to remote server
EX-LON01.contoso.com failed with the following error message: The WinRM client cannot process the request. It cannot determine the content type of the HTTP response from the destination computer. The content type is absent or invalid. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession -ConnectionURI “$connectionUri” -ConfigurationName Microsoft.Excha …
+ CategoryInfo : OpenError: (System.Manageme….RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : -2144108297, PSSessionOpenFailed

Additionally browsing the http://localhost/PowerShell site failed with HTTP 500 error and also in IIS Manager, opening Authentication settings of the PowerShell virtual directory under Default Web Site returns an error about the problem in the virtual directory’s the web.config file:

PowerShell

Resolution:

After comparing the /PowerShell virtual directory’s web.config file to the same file from a working server, it turned out there was an incorrect “<security> </security>” section where it was not allowed.
After removing the section /Powershell virtual directory was accessible and EMS was able to start and connect to the local server.

Advertisements

Get-Mailbox cmdlet returns value of the legacy msExchHomeServerName attribute

Symptoms:

PowerShell cmdlets Get-Mailbox, Get-CASMailbox and Get-Recipient returns the ServerName icorrectly.

Example:

Get-Recipient jsmith | fl Name, ServerName, DataBase

Name       : Smith, John
ServerName : EX-LON1
Database   : LON-DB01

# find out on which server has the active copy of the database

Get-MailboxDatabase LON-DB01 | fl Name, Server

Name   : LON-DB01
Server : EX-LON02

Reason:

Get-Mailbox, Get-CASMailbox and Get-Recipient returns the value of the legacy msExchHomeServerName attribute which is updated when the mailbox is created but not updated later anymore due to a change in introduced in Exchange 2010

More Information:

Exchange 2010: HomeMTA and msExchHomeServerName are not updated on mailboxes.