none
Autodiscover with Exchange Online (Office 365) RRS feed

  • Question

  • I'm working on a simple EWS MA 1.1 demo against Exchange Online in Office 365 Beta and noticed that Autodiscover is really slow (up to 2 minutes sometimes). 

     

    _service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
    _service.Credentials = new System.Net.NetworkCredential() 
      {
         UserName = "user@domain.com",
            Password = "password"
        };
    _service.AutodiscoverUrl(_primaryLabUserId, UrlValidationCallback);

    It eventually works, but not in a timely manner.  My UrlValidationCallback in this case just returns true. 

    Has anyone come across this?

     

    Saturday, February 19, 2011 6:12 PM

Answers

  • What i would suggest is that you enable tracing eg

    _service.TracEnabled = True;

    This will let you see the discover process and what's taking time what you will probably find is that because the Managed API does a SCP look-up of Active directory first its the timeout process that is causing the slow down. Within the Managed API there is a specific autodiscover class that allows you to configure the granularity of an autodiscover and turn this bit off which should speed things up  eg

     AutodiscoverService ads = new Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService();
     ads.EnableScpLookup = false;
     ads.RedirectionUrlValidationCallback = delegate { return true; };
     GetUserSettingsResponse grResp = ads.GetUserSettings("user@domain.com", UserSettingName.ExternalEwsUrl);
     Uri casURI = new Uri(grResp.Settings[Microsoft.Exchange.WebServices.Autodiscover.UserSettingName.ExternalEwsUrl].ToString());
    
     _service.uri = casURI;
    

    Cheers
    Glen

    • Marked as answer by George Durzi Saturday, February 26, 2011 9:09 PM
    Monday, February 21, 2011 2:28 AM

All replies

  • I'm working on a simple EWS MA 1.1 demo against Exchange Online in Office 365 Beta and noticed that Autodiscover is really slow (up to 2 minutes sometimes). 

     

     

    _service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
    _service.Credentials = new System.Net.NetworkCredential() 
     {
       UserName = "user@domain.com",
            Password = "password"
        };
    _service.AutodiscoverUrl(_primaryLabUserId, UrlValidationCallback);

    It eventually works, but not in a timely manner.  My UrlValidationCallback in this case just returns true. 

    Has anyone come across this?

     

     


    I'm having  a very similar issue. We aren't seeing 2 minutes, but we are seeing 10 seconds or so.  It's unacceptable for us.  Any help would be appreciated.

     

    Saturday, February 19, 2011 9:46 PM
  • What i would suggest is that you enable tracing eg

    _service.TracEnabled = True;

    This will let you see the discover process and what's taking time what you will probably find is that because the Managed API does a SCP look-up of Active directory first its the timeout process that is causing the slow down. Within the Managed API there is a specific autodiscover class that allows you to configure the granularity of an autodiscover and turn this bit off which should speed things up  eg

     AutodiscoverService ads = new Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService();
     ads.EnableScpLookup = false;
     ads.RedirectionUrlValidationCallback = delegate { return true; };
     GetUserSettingsResponse grResp = ads.GetUserSettings("user@domain.com", UserSettingName.ExternalEwsUrl);
     Uri casURI = new Uri(grResp.Settings[Microsoft.Exchange.WebServices.Autodiscover.UserSettingName.ExternalEwsUrl].ToString());
    
     _service.uri = casURI;
    

    Cheers
    Glen

    • Marked as answer by George Durzi Saturday, February 26, 2011 9:09 PM
    Monday, February 21, 2011 2:28 AM
  • Hey Glen,

    Thank you, that was very helpful. I turned off the SCP look-up and autodiscover takes about 30 seconds now, which is still pretty slow, but a lot faster than 2 minutes. 

    You were right on, the trace showed that the call to ExchangeService.Autodiscover was timing out looking for the SCP in AD. 

    I think this should be the guidance for connecting to EWS when not working in a federated domain.  Thanks again for the help!

    Saturday, February 26, 2011 9:15 PM