Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

"The Autodiscover Server couldn't be located" error

$
0
0

When attempting to use the currently logged on users credential I consistently get the "The Autodiscover Server couldn't be located" error.  The code is as follows:

    AutodiscoverRedirectionUrlValidationCallback cb =
        new AutodiscoverRedirectionUrlValidationCallback(AdUrlCb);

    ExchangeService service =
        new ExchangeService(ExchangeVersion.Exchange2010_SP2);
       
    service.UseDefaultCredentials = true;
    service.TraceEnabled = true;
    service.TraceListener = new FileBasedTraceListener();

    // ERROR on this line after the specified callback has been called twice
    service.AutodiscoverUrl("allenh@microsoft.com", cb);

This same code works fine if I replace the service.UserDefaultCredentials property set with the following line:

    service.Credentials = new WebCredentials("allenh@microsoft.com", "**********");  // ****** isn't the actual password

Thanks,

allen


Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>