Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

Outlook can't set up a profile after a move to Microsoft 365: 'An encrypted connection to your mail services is not available'

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

When Outlook cannot build a profile automatically, it shows "An encrypted connection to your mail services is not available." Microsoft lists four causes: the wrong email address typed in the wizard, an Outlook version missing the updates needed to connect to Exchange Online, an Autodiscover CNAME record that is missing or wrong, and, in organisations that synchronise Active Directory, user attributes that are not set correctly.

After a mailbox move, the DNS record and the attributes are the two to check first. That ordering is a working judgement, not something Microsoft's page says: the page does not mention migration.

What the error means

Autodiscover is the service Outlook uses to find the right Exchange server and configure itself. Microsoft's DNS page says the Autodiscover record serves to help "Outlook clients to easily connect to the Exchange Online service" and that Autodiscover "automatically finds the correct Exchange Server host and configures Outlook for users."

Microsoft's page, "Outlook can't set up a new profile by using Exchange Autodiscover for an Exchange Online mailbox in Microsoft 365", describes the symptom: when you use the Add New Account Wizard, "your Outlook profile isn't automatically set up", with the message above. A test with Microsoft Remote Connectivity Analyzer "might" return "Autodiscover cannot process the given e-mail address. Only mailboxes and contacts are allowed."

Microsoft's note on that page covers Outlook 2016 and Outlook 2013 with Exchange Online. It also says Microsoft "doesn't support manually setting up a profile in Outlook for connectivity to mailboxes in Exchange Online." So the goal is to make Autodiscover work, not to type server names by hand.

Which DNS target is correct depends on where your mailboxes live, and that is easy to forget at cut-over. Microsoft gives two answers. If all mailboxes in your organisation are in Exchange Online, the Autodiscover CNAME points to autodiscover.outlook.com. If you run an Exchange hybrid deployment, with some mailboxes still on your own servers, the public Autodiscover records for your existing SMTP domains point to an on-premises Exchange server. Microsoft's page does not say when to switch from one answer to the other during a migration, and a hybrid deployment can remain after the last mailbox has moved. Decide which state you are in before editing any record.

When you run Microsoft's Get Help troubleshooter, Microsoft says you may see a pop-up reading "This site is trying to open Get Help", and you select Open. The tool then works through setup with you and, when it finishes, "displays the results and provides additional information about how to resolve the issue."

Likely causes

Cause What you see How to confirm
Wrong email address entered Expected symptom, not stated on Microsoft's page: failure for the one user at setup Retype the address on the Auto Account Setup page
Outlook version missing required updates Expected symptom, not stated on Microsoft's page: failure on PCs with the older version Check version; Microsoft says to upgrade Outlook 2010 and earlier
Autodiscover CNAME missing or wrong Every new profile in the domain fails Only if all mailboxes are in Exchange Online: DNS lookup of autodiscover for the domain does not return autodiscover.outlook.com
Hybrid: record points to the wrong place for where the mailboxes are Failure for some users Microsoft: in a hybrid deployment the public records point "to an on-premises Exchange server"
Synced user attributes wrong Expected symptom, not stated on Microsoft's page: only synced users fail Get-RemoteMailbox output (on-premises) with an empty attribute

Prove the cause before changing anything

  1. Test with one user and one address. Retype it carefully on the Auto Account Setup page of the wizard, and confirm the password is correct. Microsoft's first check is the address.
  2. Run Microsoft's tools. Microsoft's page offers the Classic Outlook Profile Setup troubleshooter in Get Help as "Recommended method", noting it is not available for new Outlook for Windows. Administrators can also use the Domain Troubleshooting Wizard in the Microsoft 365 admin center (Domains, the domain, Troubleshoot) or Microsoft Remote Connectivity Analyzer, using its Outlook Autodiscover test.
  3. Look up the record from a PC on the user's network:
Resolve-DnsName -Name autodiscover.contoso.com.au -Type CNAME

For a domain where all mailboxes are in Exchange Online, Microsoft says to add "an Autodiscover CNAME record that points to "autodiscover.outlook.com"". For an Exchange hybrid deployment, Microsoft says to set up the Autodiscover public DNS records "to point to an on-premises Exchange server."

  1. Hybrid only: from the on-premises Exchange Management Shell, inspect the attributes for the affected user with Get-RemoteMailbox. Microsoft's example shows primarySMTPAddress, alias, displayName, emailAddresses and remoteRoutingAddress:
Get-RemoteMailbox -Identity ayla@contoso.com.au | Format-List

Save the output to a text file, for example by adding | Out-File -FilePath C:\Temp\remote-mailbox-ayla-before.txt to the command (the folder must exist). Microsoft's cause also names mail, mailNickname, displayName and proxyAddresses in the on-premises directory.

Fix

Wrong address. Correct the address and password on the Auto Account Setup page. This changes nothing else.

Old Outlook. For Outlook 2010 or earlier, Microsoft says to upgrade to the latest version of Outlook.

Save first: on each PC, record the installed Outlook version and build, and confirm the user's mail is held on the server, not only in a local data file.

Disruptive step: upgrade Outlook. Impact: it changes the client for that user, including add-ins and profile behaviour, so start with one PC and schedule the rest. Back-out: there is no documented way back to the old version; keep the recorded version only as a note of what the PC had.

Autodiscover CNAME missing or wrong, all mailboxes in Exchange Online. Only follow this step if no mailbox remains on your own servers. If some do, you are in the hybrid case in the next paragraph, and this step would break Autodiscover for those mailboxes.

Save first: record the current Autodiscover record, with its target and TTL, from the lookup above and from your DNS provider's console.

Disruptive step: in your DNS host, create or edit the autodiscover CNAME so it points to autodiscover.outlook.com. Impact: every Outlook client in the domain uses the new target as caches expire, so wrong data here breaks profile setup for the whole domain, and a mistake in the hybrid case breaks it for the mailboxes still on-premises. Microsoft's own DNS page lists the record as Alias Autodiscover, Target autodiscover.outlook.com. Back-out: restore the previous record from your note.

Autodiscover record in a hybrid deployment. Microsoft says to "set up the Autodiscover public DNS records for your existing SMTP domains to point to an on-premises Exchange server." While any mailbox is still on-premises, leave the public records pointing there. Microsoft's page does not say when to change them; the CNAME to autodiscover.outlook.com applies when "all mailboxes in your organization are in Exchange Online", so change it only after the last mailbox has moved and you no longer run a hybrid deployment.

Microsoft's page points to its DNS-records articles for the exact steps at each DNS host, and says Microsoft can help with "other tasks, such as setting up DNS and Autodiscover records".

Hybrid attributes wrong. Microsoft's page says to use Set-RemoteMailbox to update the attributes, "force directory synchronization to occur", and then try the account setup again. Microsoft's Set-RemoteMailbox page has parameters named -Alias, -DisplayName, -EmailAddresses, -PrimarySmtpAddress and -RemoteRoutingAddress. It says of -RemoteRoutingAddress: "You shouldn't have to change the remote routing address if the address was automatically configured by Exchange when the mail user and its associated mailbox in the service were created."

Save first: the text file saved in step 4 above, with the listing for this user.

Disruptive step: the command below changes one synced attribute on-premises, which changes the identity that Microsoft 365 receives. A wrong remoteRoutingAddress or emailAddresses can break mail routing for the user.

Change only the one attribute that is empty or wrong, for example:

Set-RemoteMailbox -Identity ayla@contoso.com.au -Alias ayla

To undo it, run the same command with the old value from the saved file for that attribute (the same parameter, for example -Alias with the saved alias), then synchronise again. If the attribute was empty before, the saved file holds no value to put back; note the date and the value you added, and ask the directory administrator how to clear it. Microsoft's page names no command for forcing directory synchronization; use the method documented for your synchronisation tool.

No custom domain. Microsoft says to use the Add New Account Wizard with the default onmicrosoft.com address, in the form kim@contoso.onmicrosoft.com, which "also supports Autodiscover."

Confirm the fix

Create a new test profile with the Add New Account Wizard on a PC that previously failed. A correct setup finishes without asking for server names and without the encrypted-connection message. Then re-run the Remote Connectivity Analyzer Autodiscover test; Microsoft says "If the test is successful, Autodiscover is working correctly." Test one mailbox that was moved and one that was not.

Example (illustrative): 85 mailboxes at contoso.com.au are moved in 5 batches of 17 (85 divided by 5). Until batch 5 has moved, some mailboxes remain on-premises (68 after batch 1, 17 after batch 4), so this is a hybrid deployment and the administrator leaves the autodiscover record pointing at the on-premises server mail.contoso.com.au, as Microsoft's hybrid sentence says. After batch 5 no mailbox remains on-premises and the hybrid deployment is retired, but the record still points at the old server, and new profiles fail on the warehouse PCs with the encrypted-connection message. The administrator saves the record and its TTL, changes the CNAME to autodiscover.outlook.com, and tests new profiles for one user from each of the five batches.

What to watch afterwards

  • Add the Autodiscover record to the cut-over checklist, with the old and new targets written down before the change.
  • Test a fresh profile after each batch, not only the existing profiles that already work. Leave the Autodiscover record alone until the last mailbox has moved.
  • For hybrid, check the user attributes before each batch moves.
  • Record the date the CNAME changed, so help desk staff know which failures predate it.
  • Keep the Outlook version list current. Microsoft names missing Outlook updates as one of the four causes, so a PC that fails alone after the DNS and attributes are proven correct is a candidate for a version check.
  • Re-run the Remote Connectivity Analyzer Autodiscover test after any DNS provider change, mail routing change or domain addition, and keep the result with the change record. A passing result on the day is the quickest proof that Autodiscover was not the cause of a later complaint.

Risks and limits

These commands have not been run or lab-tested. Microsoft's page names Outlook 2016 and Outlook 2013, and its Get Help tool steps run in the Get Help app. It does not describe local Autodiscover overrides or service connection points, so this does not cover them. Microsoft's page does not say how long a DNS change takes to reach every client; test again after your record's cache time has passed.

Do not hard-code server names into profiles to work around a failing lookup: Microsoft does not support it for Exchange Online mailboxes, and it will break again when mailboxes move.

Sources