Autodiscover in Outlook: What it is and how it works

Imagine how convenient it would be if users can automatically connect to their email servers without having to configure the settings manually. Well, that’s Outlook’s autodiscover in a nutshell. Let’s get to a detailed explanation of what it is and how it works.

autodiscover
Shutterstock

What is autodiscover?

Autodiscover is a service or feature that allows Outlook administrators to configure the user profile settings for Outlook 2007 and later. The advantage of this service is that it establishes the initial connections to Exchange user mailboxes, so users can access many features such as the offline address book.

To understand why this feature is so essential, let’s step back a bit. Before Outlook 2007, administrators had to configure the Exchange clients manually. This meant that administrators had to know the name of the Exchange server to configure Outlook. Also, more configurations were needed to use the latest features available in Outlook 2003.

In fact, a lot of these configurations made no sense. Still, administrators had to do it repeatedly, thereby making configuration cumbersome and, in some ways, an annoying task. It was confusing for the new users and got completely out of hand in large and complex environments with many Exchange servers.

Autodiscover was introduced in Outlook 2007 to simplify this configuration process. It automatically discovers which Exchange server holds a user’s mailbox and configures the Outlook client to connect to that server. This makes configuration a breeze, as users need only an email ID, Active Directory user name, and password to start, and quickly became popular with IT administrators.

Since it simplifies the configuration process greatly, Microsoft has made it an integral part of all Outlook clients, so if you have Outlook 2016 or later versions, you can’t manually configure the settings and must use autodiscover.

How does Outlook autodiscover work?

To minimize user interaction and work, Microsoft created the autodiscover feature to look for the configuration details automatically. The engineers at Microsoft came up with a simple design and implementation for autodiscover as it used email addresses as the starting point. With just a few DNS lookups, the feature could handle everything automatically. All the configuration information is stored in the “autodiscover.xml” file, and by default, its location is https://(exchange_server)/autodiscover/autodiscover.xml.

If this file is not available or if Outlook is unable to find it, it runs through a series of steps to get the information it wants. Note that autodiscover runs from one step to the next only if it can’t find the information it wants in the previous step.

  • Outlook creates a local file with the existing configuration data if the application or system restarts suddenly. So, the autodiscover feature looks for this local file to get the configuration details.
  • Next, it looks for the “last known good” configuration data stored in Outlook to get the details.
  • If that fails, the autodiscover feature looks for the user’s account in Office 365 and gets the corresponding details from Active Directory
  • Next, it examines the user’s email address to get the configuration info.
  • Finally, this feature examines the domain’s root DNS to check if SRV records exist, so it can get the configuration information from the host details present in the SRV records.
autodiscover
Shutterstock

After probing through these different ways, autodiscover gets the configuration information, and based on it, configures the client, so it is ready for use.

In case it is unable to get the information in any of these steps, it reports an error. Unfortunately, this error message is cryptic as it says, “Encrypted connection not available.” Though it does not relate to the non-availability of the file, this is what the error means!

Now, you might wonder what’s in that all-important autodiscover.xml file.

Contents of autodiscover.xml

This autodiscover.xml file contains all the configuration information. This is a dynamically generated file written in XML and contains the details that a user entered in the configuration wizard. Understanding the contents of this file is not easy because Outlook works in a dynamic environment, so every update is added to this file. Since autodiscover can read the contents and Outlook can interpret them, everything works fine.

The second reason is that there is no documentation available on what’s contained in it, so it is sometimes open to interpretation.

Considering these two aspects, let’s examine some of the known fields in this file.

  • First off, this XML file has the Exchange credentials needed to access the corresponding mailbox. Based on these credentials, autodiscover checks the Active Directory for the corresponding email address.
  • Next, it populates the location of the mailbox from the msExchangeHomeServer attribute on Active Directory.
  • This file contains the topology data; based on this information, Exchange determines the best Client Access Server (CAS) for accessing the mailbox.

While this is not an exhaustive list, given the dynamic nature of the autodiscover.xml file, it sure gives you an idea of the kind of information it holds.

That said, some information is a must for autodiscover to work and they are:

  • CAS server name
  • Exchange web service URL
  • MAPI over HTTPS server address
  • Outlook anywhere configuration data

The last two parameters are necessary only if they are enabled.

Internal DNS

No discussion of autodiscover is complete without explaining how you can configure it for internal DNS.

First off, Exchange 2010 brought in namespace requirements for autodiscover, so certificates became necessary. Therefore, to configure an internal DNS you need:

  • IP namespace of the primary datacenter
  • IP namespace of the secondary datacenter
  • Web app failback namespace of the primary datacenter
  • Web app failback namespace of the secondary datacenter
  • RPC client access namespace of the primary datacenter
  • RPC client access namespace of the secondary datacenter
  • Transport namespace

With all this in place, all that you have to do is create a CNAME resource record to hide the implementation details of your network from the clients. Essentially, what this means is that users can use a simple URL like mail.domain.com instead of mail.hostname.domain.com.

Note that in the later versions of Exchange, only two namespaces — IP and transport namespace, are required.

In short, autodiscover is a useful feature and also a must-have one in the latest Exchange versions. It is also useful because all configurations are handled automatically without manual intervention, thereby saving time and effort.

Have you used the autodiscover feature? What’s your take on it?

Featured image: Shutterstock

1 thought on “Autodiscover in Outlook: What it is and how it works”

Leave a Comment

Your email address will not be published.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top