Error “Failed To Connect To An Exchange Server In The Current Site” While Running Exchange 2013 Shell

I received an email today from an Exchange admin who is testing 2013 Preview & is stuck with the error mentioned while running the 2013 Shell. The detailed error is as follows. VERBOSE: Connecting to server.domain.com. New-PSSession : [server.domain.com] Connecting to remote server server.domain.com failed with the following error message : The WS-Management service does…

I received an email today from an Exchange admin who is testing 2013 Preview & is stuck with the error mentioned while running the 2013 Shell.

The detailed error is as follows.

VERBOSE: Connecting to server.domain.com.
New-PSSession : [server.domain.com] Connecting to remote server server.domain.com failed with the following error message : The WS-Management service does not support the request. 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 : WinRMOperationNotSupportedOnServer,PSSessionOpenFailed
Failed to connect to an Exchange server in the current site.
Enter the server FQDN where you want to connect.:

The fix is to run one of the prerequisite steps for installing Exchange 2013.

From an elevated command prompt, run the following.

%SystemDrive%\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir –enable
IISReset

This step is required to register ASP.NET with .NET Framework 4.5 in Internet Information Services (IIS).

Exchange admins get all excited about installing the latest version and miss the steps ;)

22 Comments

  1. Mario Borges says:

    Hi Rajith I have the dame problem.
    With Win server 2012 and MS EXCHANGE 2016.
    Also in the server Exchange the DNS IP on the ethernet adapter , change to
    8.8.8.8 and 9.9.9.9. in automatic
    What Happen?
    My mail service is stop.

    Thanks
    Mario Borges

  2. this just worked for me on an exchange server2016. thanks guys, i searched the entire internet inside out to find this

    1. Rajith Jose Enchiparambil says:

      Glad that the article helped you Ekow

  3. Hi Rajith,

    Thanks for your article on this issue.
    I followed it but getting still getting the error:

    “New-PSSession : [dbmbx01.abc.com] Connecting to remote server dbmbx01.abc.com failed with the
    following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic”

    I have 2 Ex2013 CAS servers and 2 MBX servers (all 2013 – SP1 – CU7) on Win 2008 R2 SP1.

    Followed the article – http://dbanda.blogspot.co.uk/2013/05/problem-with-exchange-2013-management.html

    The Powershell site (in IIS under Default Web site) is pointing to the right directory.

    D:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\PowerShell

    But on clicking the “Test Settings” button it gives an error “Invalid application path”.

    If I click on “connect As” and putin my same login credentials the “Test settings” is success !!

    Pls help.

    Many thanks,

    Vikas

    1. Mat Jackmond says:

      I JUST got off the phone with Microsoft, and this problem (for ME) was all
      because the PDC and the Exchange Server were NOT “TIME synchronized”!!!
      IF the Exchange Server is OFF by 6+ minutes THEN you will have this problem
      as well as EMAIL to the Outside WILL STOP!

      This article
      (https://technet.microsoft.com/en-us/library/cc816884(v=ws.10).aspx)
      provided my answer. (My PDC had ALREADY been configured to use an
      “authoritative Time”, but apparently all my other Servers were NOT being
      told to “Look to the PDC for your TIME”.
      ON ALL your DCs and ALL your Servers, open a “Command Prompt (Admin)
      and type the , type the following 3 lines (hitting enter after each
      command): (each one will take a second or 2 to complete)

      w32tm /config /syncfromflags:domhier /update (Enter)
      net stop time (Enter)
      net start time (Enter)

      Do ALL the DCs FIRST, then do the Exchange Server.

      Then you MUST reboot the Exchange Server for this to have an effect
      for Exchange. After Rebooting and waiting until ALL the services
      have come back up, I was again able to open “Exchange Management Shell”
      and “Exchange Toolbox”!

      Hope this helps someone!

      1. Rajith Jose Enchiparambil says:

        Thanks Mat for the update.

      2. Thanks alot for your note Mat Jackmond .
        I had the same issue , I saw that I had 15 minutes time deference between Exch. and DC Servers , after I changed the time settings and rebooted , all problems solved .
        you saved my day.

        1. Rajith Jose Enchiparambil says:

          Thanks for the update Ary.

  4. Ignore previous posting it was IIS 8

    1. Rajith Jose Enchiparambil says:

      Thanks Chuck.

      Good that you sorted it yourself.

      1. If it worked before, just IISReset did the job for me on Windows 2012

        1. Rajith Jose Enchiparambil says:

          Thanks Mario

        2. Thank you, it worked for me ass well

          1. Rajith Jose Enchiparambil says:

            Glad to help Radu

  5. I’m running Windows 2012 Standard with IIS 6 came with the HP server base install and the command to install 4.5 simply lists the available options and does nothing and I continue to get errors trying to run the management shell of not being able to connect.

    Should I upgrade IIS to 7 or 8 first? The cert errors are showing up for users so I have to either shutdown this box asap or fix it

    Please advise! Thanks!!

  6. Steve Bowen says:

    I am also Exchange 2013 with Server 2012 with the same problem.

    New-PSSession : [localservername.domain.com] Connecting to remote server magmail01.magnumstaffing.com failed with
    the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
    At line:1 char:1
    + New-PSSession -ConnectionURI “$connectionUri” -ConfigurationName Microsoft.Excha …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    1. Rajith Jose Enchiparambil says:

      Hi Steve,

      What build of Exchange 2013 are you using? This used to be an issue in 2013 Preview. RTM, CU1 and CU2 should work fine.
      Is Windows 2012 fully patched? If not, please do that.

  7. hi

    I have exactly the same issue and it looks like that this is the only answer all over the web but it is not helping me

    i run this command for Microsoft (R) ASP.NET RegIIS version 4.0.30319.17929 and this is what i am reciveing

    ******************************************************
    Microsoft (R) ASP.NET RegIIS version 4.0.30319.17929
    Administration utility to install and uninstall ASP.NET on the local machine.
    Copyright (C) Microsoft Corporation. All rights reserved.
    Start installing ASP.NET (4.0.30319.17929) without changing existing web applica
    tions to use this version of ASP.Net.
    This option is not supported on this version of the operating system. Administr
    ators should instead install/uninstall ASP.NET 4.5 with IIS8 using the “Turn Win
    dows Features On/Off” dialog, the Server Manager management tool, or the dism.e
    xe command line tool. For more details please see http://go.microsoft.com/fwlin
    k/?LinkID=216771.
    Finished installing ASP.NET (4.0.30319.17929) without changing existing web appl
    ications to use this version of ASP.Net.
    ******************************************************

    i also run
    C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -ir -enable
    but this time i am reciving this :

    ******************************************************
    Start installing ASP.NET (2.0.50727).
    ………………………..
    An error has occurred: 0x80004005 Unspecified error

    ******************************************************

    any suggestion ?

    1. Rajith Jose Enchiparambil says:

      Hi Rera,

      I take you are running Exchange 2013 on Windows 2012?

      1. I am having these same issues. The posted resolution didn’t work for me either.

        1. Rajith Jose Enchiparambil says:

          Hi Ezra,

          The fix works for Windows 2008 R2 SP1 as the base OS. Are you running Windows 2012?

          1. Yes, I am on Windows 2012.

Leave a Reply

Your email address will not be published. Required fields are marked *