0
votes

I am writing a Windows forms app to read a mailbox on an Exchange 2013 server. This code connects, and I can read the emails, but it can take two minutes or more to execute the AutodiscoverUrl method.

exchange = new ExchangeService(ExchangeVersion.Exchange2013_SP1);  
exchange.Credentials = new WebCredentials("USERNAME", "PASSWORD", "DOMAIN");  
exchange.AutodiscoverUrl("USERNAME@DOMAIN", RedirectionUrlValidationCallback);

This is all happening on our internal corporate network. I'm at a big company with a couple thousand servers in our data center, and I'm wondering if the AutodiscoverUrl is looping through all our servers until it finds our Exchange server? I know the name of the Exchange server; is there a way to just specify it and drive on?

1

1 Answers

0
votes

At first there are two kind of AutoDiscovery entries. An internal one and an external one. Depending on your environment (e.g. Split DNS) its not easy to give you an 100% answer how this should look like. As you seamed to be the developer from a solution you should speak with your MS Exchange administrator here, as the following might make more sense to him.

An external AutoDiscovery could be easily checked with the Microsoft Remote Connectivity Analyzer.

You could also check the autodiscovery feature with Test-OutlookWebServices if needed.

But I assume that everything is up and working as in general its working but not "fast" enough. So your option might be (instead of hardcode the CAS Server) to disable some steps in the autodiscovery process (see here for more infos). So for example if you do not need the root domain check you could disable that as outlined in the URL above via ExcludeHttpsRootDomain. However as said this should be done together with your Exchange administrator. The reason is here that if you disable some AutoDiscovery steps which are required you might break your solution once the Exchange administrator performs a change here.