The Autodiscover service couldn't be located

22,371

Solution 1

It's very unlikely that this is causing the problem. Typically, if AutoDiscover fails, it's because of invalid credentials or network connectivity issues.

Enable tracing on the ExchangeService instance (MSDN article) to see what is going on.

Solution 2

I realize this post is a few years old, but I'm offering an additional solution simply for the sake of documentation.

Another possible cause of this behavior is the client is attempting to force a TLS 1.2 connection when the EWS server is supporting only TLS 1.0. I was about to surrender investigating this very behavior - an EWS app worked on one box, and the same app failed on a different box (going to the same mailbox) - and the problem was one machine could negotiate TLS 1.0, which worked, while the other could do TLS 1.2 only, which failed. Enabling client TLS 1.0 outbound connections in the registry (HKLM\System\CCS\Services\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client, DWORD value 'Enabled' set to 0x1 fixed the problem. No reboot required.

Share:
22,371
Sanjay Zalke
Author by

Sanjay Zalke

Updated on September 11, 2020

Comments

  • Sanjay Zalke
    Sanjay Zalke over 3 years

    I have code to send email using Exchange Web Services (EWS 1.1 API). There is no exception if I use the hardcoded parameter values, like:

    service.AutodiscoverUrl("[email protected]",
        delegate
        {
        return true;
        });
    

    But If I try to use a variable then I am getting error while discovering URL, "The Autodiscover service couldn't be located".

    string userName = "[email protected]";
    service.AutodiscoverUrl(userName,
        delegate
        {
        return true;
        });
    

    Is there any way to use variables with autodiscoverurl method? What am I doing wrong?

    Sanjay

  • Auguste Van Nieuwenhuyzen
    Auguste Van Nieuwenhuyzen over 11 years
    I enabled tracing and get nothing. This is a single-server exchange server that I configured myself (for testing), so I assume I've missed something - but don't know where to go from 'The Autodiscover service couldn't be located.', with no more detail when trace enabled.
  • dovla110010101
    dovla110010101 over 9 years
    I have same situation, when I pass string variable I get: The Autodiscover service couldn't be located... I need to hard code it and it works flawlessly, did anyone found any solution to this problem. P.S. I'm using EWS 2.0
  • Henning Krause
    Henning Krause over 9 years
    But you have AutoDiscover configured, haven't you?
  • RalphChapin
    RalphChapin over 9 years
    @SanjayZalke could you share with us that silly mistake, so we could verify if we're also making that mistake?
  • Sanjay Zalke
    Sanjay Zalke over 9 years
    @JerryOL I should have write little bit more :) As I mentioned in code I had issues when used as variable. I was passing variable from config file and the value did had a wrong email address. To eliminate I have wrote test to check above couple of line of code and print it to console to check. That's why ... Silly mistake.
  • RalphChapin
    RalphChapin over 9 years
    The problem I had was due to using the email address when I should have been using the domain user account in: ExchangeService.Credentials = new WebCredentials(string username, string password, string domain);