Dec 14, 2025

Prevent Outlook from connecting to Office 365

4 min readBeginner

An Outlook client with a profile pointing at an on-premises Exchange mailbox can suddenly start showing a Microsoft sign-in prompt that never accepts the credentials. The status bar reads Trying to connect, and the mailbox never connects even after a new profile is created. In this guide you will learn why Outlook forces a connection to Microsoft 365 and how to prevent Outlook from connecting to Office 365 with a single registry key.

The sign-in prompt keeps coming back

The Microsoft sign-in window appears every time Outlook starts. Entering the email address and clicking Next shows the message This username may be incorrect, and the mailbox stays disconnected.

Symptom Observed result
Outlook start Microsoft sign-in prompt appears and the status bar shows Trying to connect
Credentials entered This username may be incorrect message
New Outlook profile Same prompt, asking for the account used to open autodiscover.xml

The mailboxes are not in Microsoft 365 at all, so the prompt is a side effect of Outlook trying the cloud first.

Why Outlook connects to Office 365

Newer Outlook versions force a direct connection to Microsoft 365 during autodiscover before they consult the Exchange Server on-premises URL. This applies to Outlook 2016, Outlook 2019, and Outlook for Microsoft 365. When a new domain is added to the Microsoft 365 tenant, Microsoft treats the domain as cloud-hosted and Outlook tries the Microsoft 365 autodiscover endpoint, even though the mailbox lives on the on-premises Exchange Server.

The registry setting ExcludeExplicitO365EndPoint tells Outlook to skip the explicit Microsoft 365 endpoint and use the on-premises autodiscover service instead.

Add the ExcludeExplicitO365EndPoint registry key

Create the registry value on each affected client. The registry path depends on the Outlook version, which is 16.0 for all three current versions.

Outlook version Registry subkey
Outlook 2016 HKEY_CURRENT_USERSoftwareMicrosoftOffice16.0OutlookAutoDiscover
Outlook 2019 HKEY_CURRENT_USERSoftwareMicrosoftOffice16.0OutlookAutoDiscover
Outlook for Microsoft 365 HKEY_CURRENT_USERSoftwareMicrosoftOffice16.0OutlookAutoDiscover
1
Open Registry Editor

Run regedit as administrator on the client computer.
2
Navigate to the AutoDiscover subkey

Go to HKEY_CURRENT_USERSoftwareMicrosoftOffice16.0Outlook and create the AutoDiscover subkey if it does not exist.
3
Create the value

Create a DWORD (32-bit) value named ExcludeExplicitO365EndPoint and set it to 1.
4
Restart Outlook

Close and reopen Outlook. On some systems a full restart is required for the change to take effect.
Registry Editor showing the ExcludeExplicitO365EndPoint DWORD value set to 1 under the Outlook AutoDiscover subkey

Verify the connection to Exchange on-premises

Restart Outlook and confirm the sign-in prompt is gone and the mailbox connects to the on-premises server.

1
Check the existing profile

Start Outlook and confirm the Microsoft sign-in prompt does not appear and the mailbox connects.
2
Create a new profile

Create a fresh Outlook profile and confirm it connects to the Exchange Server on-premises without the prompt.

You do not have to recreate the existing profiles after adding the registry key.

Remove the key after migrating to Microsoft 365

Once mailboxes are migrated to Microsoft 365, Outlook should be allowed to use the Microsoft 365 endpoint again. Delete the ExcludeExplicitO365EndPoint value from the clients when the migration is complete so autodiscover works normally for cloud mailboxes.

Frequently asked questions

Why does Outlook keep asking for Microsoft 365 credentials?

Outlook forces a direct connection to Microsoft 365 during autodiscover and skips the on-premises Exchange Server autodiscover URL.

Which Outlook versions are affected?

Outlook 2016, Outlook 2019, and Outlook for Microsoft 365.

What does ExcludeExplicitO365EndPoint do?

It tells Outlook to skip the explicit Microsoft 365 autodiscover endpoint and use the on-premises autodiscover service instead.

Do I need to recreate Outlook profiles?

No. The registry key works with the existing profiles, so no profiles need to be recreated.

When should I remove the registry key?

Remove it after the mailboxes are migrated to Microsoft 365 so Outlook can use the Microsoft 365 autodiscover endpoint again.