EWS Autodiscover takes 16+ Seconds to Discover Mailbox server for O365 user

Exchanger Hybrid setup with an On Premise Exchange 2010 server.

We have some backend Managed EWS code that accesses user mailboxes and we are using the AutoDiscover to return the Mailbox server URL for the user.   The code before would take less than a second to return the on-Premise server URL, though now when we query for a O365 user it takes 16 or so seconds to return the Mailbox server URL.

Is this always going to be the case when querying for a O365 user?


RedirectionCallback: https://autodiscover-s.outlook.com/autodiscover/autodiscover.xml

Query: <O365User>@costono.com
https://outlook.office365.com/EWS/Exchange.asmx
00:00:16.1582740

Query: <On-PremUser>@costono.com
https://<on-prem-server>/EWS/Exchange.asmx
00:00:00.5937753

Open in new window


Thanks!
LVL 3
Scott TownsendIT DirectorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
Well it's pretty much the time it takes.
At least you give the full "EWS" address.

The flow is as follows
domain.com
autodiscover.domain.com
HTTP (within a server)
Http redirection (to O365)
SRV DNS record

If it's taking too much time makes sure your autodiscover is set to your On-premises since it's the one that can do the redirection, O365 doesn't do any redirection to your on-premises.

Also you can test the autodiscover service using ECA
https://testconnectivity.microsoft.com/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Autodiscover service

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.