Autodiscover investigation

You can find out information about a mail account (such as what the server host name is) using the Autodiscover protocols.

The important documents are:
  • [MS-OXDISCO] which tells you where to ask.
  • [MS-OXDSCLI] which tells you what to ask for.

Here is a typical request (extracted from [MS-OXDSCLI], noting that the Microsoft specs omit the first line:

<?xml version="1.0"?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/requestschema/2006">
  <Request>
    <EMailAddress>testuser1@frogmouth.local</EMailAddress>
    <AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a</AcceptableResponseSchema>
  </Request>
</Autodiscover>

You can run a query on the command line with something like curl:
$ curl --ntlm -k -X POST -H 'Content-Type: text/xml; charset=utf-8' -d @request.xml https://Administrator:mypass@192.168.40.120/Autodiscover/Autodiscover.xml

where request.xml contains the request above. The curl options:
  • --ntlm means to use NTLM authentication. You can probably use other kinds depending on the server configuration.
  • -k means to ignore certificate mismatch / errors. This is insecure, but useful for investigation.
  • -X POST means to make a POST request, rather than a GET
  • -H 'Content-Type: ...' means to use a different header (the default is for URL encoded forms)
  • -d @request.xml means to read the data for the POST from the filename specified. If you omit the @ sign, you can specify the whole query on the command line.
  • the URL at the end is where to submit the POST request to (which you should find using the process in [MS-OXDISCO])

Authentication is required, but I could only get it to work using the Administrator account. I don't know why.

If everything is OK, then you'll get back a response like:

<?xml version="1.0" encoding="utf-8"?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
  <Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
    <User>
      <DisplayName>test user1</DisplayName>
      <LegacyDN>/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=test user1</LegacyDN>
      <DeploymentId>01f4f917-29c6-49f1-b160-ccff0e2baaf5</DeploymentId>
    </User>
    <Account>
      <AccountType>email</AccountType>
      <Action>settings</Action>
      <Protocol>
        <Type>EXCH</Type>
        <Server>WIN-HN58J1UJDE0.frogmouth.local</Server>
        <ServerDN>/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=WIN-HN58J1UJDE0</ServerDN>
        <ServerVersion>7380827F</ServerVersion>
        <MdbDN>/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=WIN-HN58J1UJDE0/cn=Microsoft Private MDB</MdbDN>
        <PublicFolderServer>WIN-HN58J1UJDE0.frogmouth.local</PublicFolderServer>
        <AD>WIN-HN58J1UJDE0.frogmouth.local</AD>
        <ASUrl>https://win-hn58j1ujde0.frogmouth.local/EWS/Exchange.asmx</ASUrl>
        <EwsUrl>https://win-hn58j1ujde0.frogmouth.local/EWS/Exchange.asmx</EwsUrl>
        <EcpUrl>https://win-hn58j1ujde0.frogmouth.local/ecp</EcpUrl>
        <EcpUrl-um>?p=customize/voicemail.aspx&amp;exsvurl=1</EcpUrl-um>
        <EcpUrl-aggr>?p=personalsettings/EmailSubscriptions.slab&amp;exsvurl=1</EcpUrl-aggr>
        <EcpUrl-mt>PersonalSettings/DeliveryReport.aspx?exsvurl=1&amp;IsOWA=&lt;IsOWA&gt;&amp;MsgID=&lt;MsgID&gt;&amp;Mbx=&lt;Mbx&gt;</EcpUrl-mt>
        <EcpUrl-sms>?p=sms/textmessaging.slab&amp;exsvurl=1</EcpUrl-sms>
        <OOFUrl>https://win-hn58j1ujde0.frogmouth.local/EWS/Exchange.asmx</OOFUrl>
        <UMUrl>https://win-hn58j1ujde0.frogmouth.local/EWS/UM2007Legacy.asmx</UMUrl>
        <OABUrl>http://win-hn58j1ujde0.frogmouth.local/OAB/83abf359-2680-426a-9e69-33872651f17d/</OABUrl>
      </Protocol>
      <Protocol>
        <Type>EXPR</Type>
        <Server>win-hn58j1ujde0.frogmouth.local</Server>
        <SSL>On</SSL>
        <AuthPackage>Basic</AuthPackage>
      </Protocol>
      <Protocol>
        <Type>WEB</Type>
        <Internal>
          <OWAUrl AuthenticationMethod="Basic, Fba">https://win-hn58j1ujde0.frogmouth.local/owa/</OWAUrl>
          <Protocol>
            <Type>EXCH</Type>
            <ASUrl>https://win-hn58j1ujde0.frogmouth.local/EWS/Exchange.asmx</ASUrl>
          </Protocol>
        </Internal>
      </Protocol>
      <AlternativeMailbox>
        <Type>Archive</Type>
        <DisplayName>Online Archive - test user1</DisplayName>
        <LegacyDN>/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=test user1/guid=6b53771a-c6d8-4a59-a9ce-fd02b72f3515</LegacyDN>
        <Server>WIN-HN58J1UJDE0.frogmouth.local</Server>
      </AlternativeMailbox>
    </Account>
  </Response>
</Autodiscover>

The meaning of each of those entries is explained in [MS-OXDSCLI] Section 2.

Also available in: HTML TXT