Office 365 – Outlook Autodiscover Fails

So, the Autodiscover for Office 365 just doesn’t work, sometimes.  We happened to be in that boat, and we tried checking the domain in Office 365 (everything is set up correctly), tried the Microsoft Remote Connectivity Analyzer (also said everything is fine), and tried changing group policies to disable some of the Autodiscover methods (now it fails faster).

So we were down to using the Office 365 Support and Recovery Assistant to set up every new profile.  This is slow and can’t set up profiles that connect to more than on tenant (since it forces you to create a new profile each time you run it).

Fortunately, in this guide (https://www.howto-outlook.com/howto/autodiscoverconfiguration.htm) to setting up Autodiscovery, it mentions using a local autodiscover.xml file.  I was able to set this up, so it has the redirection information, so Outlook can go right to it, fixing all our setup problem.

Between our two tenants, the xml file was the same, so hopefully this is a universal and can work for you too.

First, create your xml file (the file name doesn’t matter as long as you know it later):

<?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">
    <Account>
      <AccountType>email</AccountType>
      <Action>redirectUrl</Action>
      <RedirectUrl>https://autodiscover-s.outlook.com/autodiscover/autodiscover.xml</RedirectUrl>
    </Account>
  </Response>
</Autodiscover>

Now, you need to add a registry key to make Outlook use this file.  Create a new REG_SZ key in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Outlook\AutoDiscover, the value name is the mail domain you’re using, the value is the path to the xml file.

You can bundle this part up with PowerShell:

$localpath = "C:\autodiscover"
$autodfile = "autodiscover.xml"
$regpath = 'HKCU:\SOFTWARE\Microsoft\Office\16.0\Outlook\AutoDiscover'
$key = 'mail.domain'
$value = ($localpath+'\'+$autodfile)
#check if the key is already there
$out = $null
$out = Get-ItemProperty -Path $regpath -Name $key -ErrorAction SilentlyContinue
#add key if not present
if (!$out) { New-ItemProperty -Path $regpath -Name $key -Value $value -PropertyType String }

 

Advertisements