Exchange Server 2010 SP1 Beta Hosting Deployment… Part #9 – Autodiscover

How should I really start this post? Conceptually, the way Outlook uses Autodiscover in Exchange 2010 SP1 beta hosting deployment hasn’t changed compared to HMC. I blogged how Autodiscover work in HMC back in early 2009. It is here for those who are interested, HMC 4.5 and Exchange 2007 SP1 – Part #5 – Autodiscover in the Multi-tenancy environment (

So, what has changed? Really not much at all. So, I am going to keep it short and I will just provide a summary of how Autodiscover work in a Hosted Exchange environment.

 Outlook 2007 or Outlook 2010 will attempt to locate and connect to an Autodiscover service based on the e-mail domain of the user. For example, for the user, Outlook 2007/2010 will automatically try to connect to the following URLs in this sequence,

It looks like the following, actually,

As you can see above, the first two will fail. The 3rd one is a HTTP instead of HTTPS and each of the tenant needs to configure in their domain an Autodiscover entry and point it to the AutodiscoverRedirection web site you created as per the Hosting Deployment (this could be an A record or CNAME record. Of course, if it is an A record, it will need the IP address). The AutodiscoverRedirection site will then redirect it to your actual Autodiscover HTTPS site. And the rest, you know it is where the Outlook Provider will query the Service Discovery and etc. etc. You can take a look at here if you need more information (

Why do we need to do all these DNS pointing, HTTP redirection and etc. etc.? Well, it is needed because Autodiscover happens in HTTPS or SSL and to ease the configuration, Outlook automatically pick up from the email address as the domain and attempt to connect through SSL using the user’s email domain. As a hoster, you may host many many domains and it is impossible for you to host all the certificates for all the domain you are hosting and hence the need to redirect them appropriately so that we do not have issues like certificate not matching to name error.

Now, I also took the Exchange 2007 SDK, one of their Autodiscover code and enhance it a little bit and compile it to help my own testing when I need to. I also attaching here it here. As you can see, this tool actually sort of walk through the Autodiscover process and that you can see what’s wrong with it. You don’t need to have Outlook in order to see if your Autodiscover is working and you can use it in lab or to test forest to forest autodiscover scenario (not in hosting, of course). You can also specify the specific autodiscover url and etc. if you need to.


Autodiscover Testing Utility:

AutodiscoverTest.exe -email:<emailaddress> [-allowselfsigned:{true|false}] [-username:<username>] [-password:<password>] [-url:<autdiscover url>]


  emailAddress – smtp address to autodiscover
  true|false – allow self signed certificates, default – false
  username – user name for https: requests authentication, eg. <domain\user> or UPN
  password – user password for https: requestsauthentication
  url – specify a specific url for autodiscover test

 If username/password/domain are not specified, default credentials are used.


Password not defined!
Please enter your password: **********

..starting Autodiscover test for ‘’
..using the specified credentials for HTTPS

..verifying E-mail address.

..starting SCP Lookup for SCP Lookup failed and skipped.
..message source: System.DirectoryServices
..message: The specified domain either does not exist or could not be contacted.

..trying ‘’ at ‘’ failed and skipped.
..message: The remote name could not be resolved: ‘’ status code: NameResolutionFailure

..trying ‘’ at ‘’ failed and skipped.
..message: The underlying connection was closed: An unexpected error occurred on  a send. status code: SendFailure

..trying GET redirect URL on non-SSL URL ‘’
..redirection found:
‘’at ‘’

User/LegacyDN=/o=ConsolidatedMessenger/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Administratorb811ff42
Account/Protocol/MdbDN=/o=ConsolidatedMessenger/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=CASHT01/cn=Microsoft Private MDB
Account/Protocol/ServerDN=/o=ConsolidatedMessenger/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=CASHT01




Account/Protocol/Internal/OWAUrl[@AuthenticationMethod=”Basic, Fba”]=

So, that’s it for today, folks. Hope you find this helpful.

 Read More…

Comments (11)

  1. Pronichkin says:

    Hi Kip,

    Is Autodiscover Redirect at least supposed to work with Windows Mobile 6.5 devices? In my lab, desktop Outlook works fine and easily finds my Hosting Exchange server. But my phone cannot find it automatically, so I have to set up it manually. Of course, the pnone uses all the same network settings as the desktop.

  2. Kip Ng says:

    Yes, it should work as far as I know.

  3. Jonas says:

    Hi Kip,

    Just found your tool and wanted to say that it's really great!

    🙂 thanks for sharing

  4. Oliver Salzburg says:

    I was just playing around with AutoDiscovery and was trying your tool.

    It would be great if you could handle a certain exception:

    ..trying ‘’ at ‘…/autodiscover.xml&

    System.InvalidOperationException: There is an error in XML document (1, 1). —> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

      at System.Xml.XmlTextReaderImpl.Throw(Exception e)

      at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()

      at System.Xml.XmlTextReaderImpl.ParseDocumentContent()

      at System.Xml.XmlReader.MoveToContent()

      at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderAutodiscoverResponseXml.Read9_Autodiscover()

      — End of inner exception stack trace —

      at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

      at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)

      at AutodiscoverTest.Autodiscover.DeserializeResponse(Stream responseStream)

      at AutodiscoverTest.Autodiscover.DiscoverTryUrl(String emailAddress, NetworkCredential nc, String url, Boolean authoritative, Boolean allowSelfSignedCerts)

      at AutodiscoverTest.Autodiscover.DiscoverTryUrls(String emailAddress, NetworkCredential nc, List`1 urls, Boolean authoritative, Boolean allowSelfSignedCerts,

    Int32& maxHops)

      at AutodiscoverTest.Autodiscover.Discover(String emailAddress, NetworkCredential nc, Int32& maxHops, Boolean allowSelfSignedCerts)

      at AutodiscoverTest.AutodiscoverTest.Main(String[] args)

    The site did return a non-xml document (and it was to be expected).

  5. KIP says:

    @ Jonas, glad you like it.

    @ Oliver, does that exception work with Outlook? If yes, I can look into it, if not, there is no pointto handle that exception

  6. Nitin Arora says:

    Hi Kip,

    Can you share the code for autodiscovery app?



  7. KIP says:

    @ Nitin, you can get the sample autodiscover code from the Exchange 2010 (EWS) SDK. I added a couple of checks and parameters. It is better for you to get it directly from the SDK as they may have updated it with additional stuff or redirection.

  8. Anonymous says:

    So lately I’ve had a few customers ask ..

    “How come I haven’t heard about this

  9. Kirk de Jesus says:

    We hosted our company intranet using sharepoint 2010 hosting

  10. aw says:

    hai, I just want to tell you that I am just very new to blogs and seriously loved this website. More than likely I’m planning to bookmark your blog post .
    You amazingly come with really good posts. Thanks a lot for sharing your blog Microsoft.

  11. anonymouscommenter says:

    Pingback from The Exchange toolkit | Chad Solarz – Exchange PFE experiences

Skip to main content