Wednesday, 18 November 2015

Exchange 2013, 2016 - Connecting to remote server failed with the following error message

Yesterday I saw an issue where the Exchange Management Shell wouldn't connect so thought I'd replicate it in my lab and let you know how to fix it. The error is below:

New-PSSession : [litex01.litwareinc.com] Connecting to remote server litex01.litwareinc.com failed with the following error message : [ClientAccessServer=LITEX01,BackEndServer=litex01.litwareinc.com,RequestId=357032aa-2312-477e-be88-8d99 db9027c5,TimeStamp=18/11/2015 00:40:28] [FailureCategory=Cafe-SendFailure]  For more information, see the about_Remote_Troubleshooting Help topic.

image

After looking through the event logs, I came across this event which provides a bit more information:

Event ID:      15021
An error occurred while using SSL configuration for endpoint 0.0.0.0:444.  The error status code is contained within the returned data.


image

As I can’t get into the Exchange Management Shell to check the Exchange certificate assignment, I moved on to check IIS. Both the Default Web Site and the Exchange Back End website need to have this certificate assigned. In IIS, you can’t have both sites listening on port 443 without a hostname configured so Microsoft have got around this so that when Exchange is installed, the Exchange Back End web site actually has a binding of port 444 for HTTPS which matches the event above. So, we’ll go ahead and check that this web site has the correct certificate configured in the bindings.

To check this, first open up IIS Manager:

image

Then right click on the Exchange Back End and click on Bindings:

image

Double click on https and ensure that there is a certificate selected:

image

As you can see, there’s no certificate selected. Go ahead and select the correct certificate:

image

Once done, click on OK then click Close. Close and reopen the Exchange Management Shell and now things look much better:

image

Outlook and OWA should now start to work also. All the best!

12 comments:

  1. Excellent article...resolve my problem:) Thanks!!!

    ReplyDelete
  2. Thanks !!!
    resolved my problem too ...

    ReplyDelete
  3. Mac,

    Please help i have done the steps above but still receives error.


    VERBOSE: Connecting to MIM-02.mim.ac.mw.
    New-PSSession : [mim-02.mim.ac.mw] Connecting to remote server mim-02.mim.ac.mw failed with the following error
    message : The client cannot connect to the destination specified in the request. Verify that the service on the
    destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service
    running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following
    command on the destination to analyze and configure the WinRM service: "winrm quickconfig". 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], PSRemotin
    gTransportException
    + FullyQualifiedErrorId : CannotConnect,PSSessionOpenFailed

    ReplyDelete
  4. Excellent article...resolve my problem:) Thanks!!!

    ReplyDelete
  5. Hi Mac,

    New-PSSession : [XXXXXXXXXX] Connecting to remote server XXXXXXXXXX failed
    with the following error message : The WinRM client received an HTTP server
    error status (500), but the remote service did not include any other
    information about the cause of the failure. For more information, see the
    about_Remote_Troubleshooting Help topic.
    At C:\JenkinsSlave\workspace\EIM_Changes\PWConfig\ConfigEIMChanges.ps1:16
    char:12
    + $Session = New-PSSession -ComputerName $Server -credential $Cred
    -Authentication ...
    +
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:Re
    moteRunspace) [New-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : WinRMHttpError,PSSessionOpenFailed

    ReplyDelete
  6. Your my hero. Thank you so much.

    ReplyDelete
  7. Thank you so much..!!
    you save my midnight time today.,

    ReplyDelete
  8. Perfect! - 2 Years Later Same Issue Resolved
    Thank You

    ReplyDelete