Microsoft Outlook 2019 unable to connect to on-premise Exchange Server "The name cannot be matched to a name in the address list."

I had a user unable to connect to my on-premise Exchange server. The issue only occured with Office 2019 or newer.

Error message

While adding an Exchange account in Outlook 2019, you enter the email address and user credentials then receive the message “The name cannot be matched to a name in the address list.” The name cannot be matched to a name in the address list

Conditions

  1. The account is properly listed in the Global Address List, not hidden.
  2. The ADSIEdit data displayed for the affected user shows that the user is properly listed in the necessary Address Lists.1
  3. Server is onsite/local Exchange 2016 or Exchange 2019 without Office 365.
  4. Client running Windows 10 with Outlook 2019, not domain joined.
  5. When the client is running Office 2016 or earlier, the problem does not occur.
  6. Adding Exchange account gives “The name cannot be matched to a name in the address list.” which is caused by Outlook being unable to find the user in Office 365.
  7. The on-premise domain has correct DNS entries for AutoDiscover; the Microsoft Remote Connectivity Analyzer connects fine. 2
  8. Using the in Outlook “Test Email AutoConfiguration” (via the Outlook tray icon, Ctrl+Shift Right click, Test Email AutoConfiguration) fails showing a connection attempt to “https://outlook.live.com/owa” and “https://outlook.live.com/owa/outlook.com” and various connections to https://outlook.office365.com/* and AutoDiscover to https://outlook.office365.com/autodiscover/autodiscover.xml which is incorrect since the account is not on Office 365.

Cause

Outlook 2019 seems to prioritize IMAP, POP3, and then default to Office365 before even attempting on-premise AutoDiscover discovery. Prevent the Office 365 AutoDiscover and Outlook 2019 appears to find the on-premise Exchange server without issue.

Workaround

  1. Run regedit as the affected user on the client.
  2. Navigate to HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\AutoDiscover (create the key if needed)
  3. Add DWORD ExcludeExplicitO365Endpoint and set value to 1

Further Reading

  1. https://support.microsoft.com/en-us/help/2212902/unexpected-autodiscover-behavior-when-you-have-registry-settings-under
  2. https://answers.microsoft.com/en-us/msoffice/forum/all/outlook-2019-sometimes-failing-to-add-an-exchange/ac49f0f3-caef-4a31-949c-d91f34fd8ab6

  3. https://docs.microsoft.com/en-us/Exchange/architecture/client-access/autodiscover?view=exchserver-2019

References