In some cases, when you try to connect a new mailbox hosted on an on-premises Exchange Server or Microsoft 365 (Exchange Online), Outlook shows the following error after you enter your email address and password (or after Autodiscovery is done):
The action cannot be completed. The name cannot be matched to a name in the address list.
This problem when connecting a mailbox in Outlook may have different reasons. Let’s try to list the most obvious ones.
If a user mailbox has been created recently, you may just need to wait a while before connecting it in Outlook.
Then make sure that the user mailbox is not hidden from the address book. In on-premises Exchange, you need to connect to the Exchange Server host server using PowerShell and run the command below:
Get-Mailbox -Identity k.peterson | Select DisplayName,UserPrincipalName, HiddenFromAddressListsEnabled
If the user is hidden, disable this attribute with the following command:
Set-Mailbox -Identity k.peterson -HiddenFromAddressListsEnabled $false
In Exchange Online (Microsoft 365), you can enable or disable the Hide from address list attribute in Microsoft 365 admin center.
Click Users -> Active Users -> find the user -> Mail -> Edit Exchange Properties. You will be forwarded to Exchange Admin Center (EAC).
Uncheck the Hide from address lists option.
Or, you can clear the HiddenFromAddressListsEnabled
attribute via PowerShell using the Set-Mailbox
cmdlet (after connecting to an Exchange Online tenant with EXOv2 PowerShell module).
After a while, make sure the user is displayed in the Exchange address book (Global Address List). Connect the Exchange mailbox in Outlook.
If it did not help, remove all saved credentials related to Microsoft Office in Windows Credential Manager (Control Panel -> User Accounts -> Credential Manager -> Windows Credentials).
Delete saved data under the HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Identity registry key and restart your computer.
Try to create a new e-mail profile in Outlook (Control Panel -> Mail) and connect to your Exchange mailbox.
In on-premises Exchange, make sure if the showInAddressBook user attribute has correct values. Open it in the AD Attribute Editor to make sure that at least two DNs are set:
CN=All Users,CN=All Address Lists,CN=Address Lists Container,CN=…
CN=Default Global Address List,CN=All Global Address Lists,CN=…
Compare the values with those of other users.
Also, make sure that the following user attributes are filled in and consistent: LegacyExchangeDN
, homeMDB
, homeMTA
, mail
, mailNickname
, msExchHomeServerName
, msExchMailboxGuid
, msExchMailboxSecurityDescriptor
, proxyAddresses
.
If the problem occurs only in Outlook 2019 or Outlook 2016 and the mailbox is located on the on-prem Exchange server, then disable Office 365 AutoDiscover using the ExcludeExplicitO365Endpoint registry parameter:
reg add HKEY_CURRENT_USER\Software\Microsoft\Office\x.0\Outlook\AutoDiscover /t REG_DWORD /v ExcludeExplicitO365Endpoint /d 1
ExcludeExplicitO365Endpoint
attribute was described in detail in the article Outlook continually prompts for password.Restart your computer. Outlook should now be able to discover your on-premise Exchange without any problems.