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