Exchange 2013 coexistence with 2019, autodiscover from external not working

Louis CI Lo 65 Reputation points
2023-09-18T02:27:14.0466667+00:00

Hi,

I have an environment with Exchange 2013 coexistence with 2019 hybrid, oauth enabled. There are F5 load balancers and firewall in between Internet and Exchange servers.

When we tested internal network, Outlook 2019 works fine. all OK.

We we tested external network, Outlook with IOS/Andriod also works fine, no issue was found now.

However, when we wanna double confirm oAuth, we got errors when running command "Test-oAuthConnectivity" and using "Microsoft Remote Connectivity Analyzer".

Please kindly advise whats going on? which part could cause this issue? Thanks.

Error:

Testing Outlook Mobile Hybrid Modern Authentication (HMA) for SMTP email address: ******@contos.com.

Testing Outlook Mobile Hybrid Modern Authentication (HMA) failed.

Additional DetailsElapsed Time: 8990 ms.

Test StepsSending an Autodiscover request to the on-premises Exchange Autodiscover service: on-premises Exchange Autodiscover service didn't return a valid response that passed analysis.Test

Steps

Sending an Autodiscover request to the on-premises Exchange Autodiscover service:

The on-premises Exchange Autodiscover service didn't return a valid response.Additional

DetailsException details:
Message: The underlying connection was closed: An unexpected error occurred on a receive.
Type: System.Net.WebException
Stack trace:
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.M365.RCA.Services.RcaHttpRequest.GetResponse()

Exception details:
Message: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Type: System.IO.IOException
Stack trace:
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)

Exception details:
Message: An existing connection was forcibly closed by the remote host
Type: System.Net.Sockets.SocketException
Stack trace:
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,858 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
2,274 questions
{count} votes

Accepted answer
  1. Shaofan Lv-MSFT 6,915 Reputation points Microsoft External Staff
    2023-09-27T09:26:56.29+00:00

    Hi @Louis CI Lo

    Thanks for the share so that others experiencing the same thing can easily reference this!

    Since the Microsoft Q&A community has a policy that "[The question author cannot accept their own answer. They can only accept answers by others)], I'll repost your solution in case you'd like to "[Accept] the answer :)


    ***[ Exchange 2013 coexistence with 2019, autodiscover from external not working] ***

    **Resolution: **

    The root cause is the Firewall setting.

    1. Test-OAuthConnectivity PS failed: We misconfigure some settings in firewall so Autodiscover and EWS from External is not working;
    2. Microsoft Remote Connectivity Analyze Tools failed: Firewall missed to allow some IPs in https://learn.microsoft.com/en-us/microsoft-365/enterprise/urls-and-ip-address-ranges?view=o365-worldwide, Commom ID 46
       [https://learn.microsoft.com/en-us/connectivity-analyzer/exchange-remote-connectivity-analyzer-tool](https://learn.microsoft.com/en-us/connectivity-analyzer/exchange-remote-connectivity-analyzer-tool)
      

    Regards

    Shaofan

    1 person found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Shaofan Lv-MSFT 6,915 Reputation points Microsoft External Staff
    2023-09-19T09:46:39.4133333+00:00
    1 person found this answer helpful.

  2. Louis CI Lo 65 Reputation points
    2023-09-27T09:20:43.94+00:00

    Hi all,

    Thanks all of your information. For future reference:

    We found out the root cause is the Firewall setting.

    1. Test-OAuthConnectivity PS failed: We misconfigure some settings in firewall so Autodiscover and EWS from External is not working;
    2. Microsoft Remote Connectivity Analyze Tools failed: Firewall missed to allow some IPs in https://learn.microsoft.com/en-us/microsoft-365/enterprise/urls-and-ip-address-ranges?view=o365-worldwide, Commom ID 46

    https://learn.microsoft.com/en-us/connectivity-analyzer/exchange-remote-connectivity-analyzer-tool

    1 person found this answer helpful.
    0 comments No comments

  3. Amit Singh 5,231 Reputation points
    2023-09-18T05:55:21.82+00:00

    First point related DNS records, update the virtual directories to 2019 and migrate all mailboxes to 2019, then shut down the 2013 temporarily. If all works well, then you could decommission your 2013 server.

    For the migration, refer to the step-by-step guide: How Do I Migrate from Exchange 2013 to 2019?

    Please Note: Since the web sites are not hosted by Microsoft, the links may change without notice. Microsoft does not guarantee the accuracy of this information.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.