Exchange - Outlook sign-in prompts to Office 365

View as Markdown

Diagnose and fix the recurring Outlook sign-in prompts pointing to Office 365 when your mailbox is actually hosted on Exchange OVHcloud

Objective

Outlook may repeatedly display a Microsoft 365 sign-in window asking for your credentials, sometimes accompanied by the message "Tell us the account you want to use to open autodiscover.xml". This window can reappear even after restarting Outlook or creating a new profile. Yet the affected mailbox is not hosted in the Microsoft cloud: it is located on an Exchange OVHcloud solution (Hosted Exchange or dedicated Exchange).

This behaviour is caused by an Outlook feature called "Direct Connect to Office 365", which forces the client to query the Office 365 autodiscover and bypasses the one on your Exchange OVHcloud server.

This guide explains how to identify the cause of these repeated connection prompts and prevent Outlook from connecting to Office 365.

Requirements


OVHcloud Control Panel Access

  • Direct link:
  • Navigation path: Web Cloud > Exchange > Select your platform

Information regarding the management and configuration of OVHcloud services

OVHcloud provides services which you are responsible for with regard to their configuration and management. You are therefore responsible for ensuring they function correctly.

This guide is designed to assist you in common tasks as much as possible. Nevertheless, we recommend that you contact a specialist service provider and/or the software publisher if you experience any difficulties. OVHcloud cannot provide you with technical support in this regard. You can find more information in the "Go further" section of this guide.

Instructions

Understanding the problem

Microsoft introduced an Outlook feature called "Direct Connect to Office 365". When it is active, Outlook connects directly to the Office 365 autodiscover and ignores your Exchange server's autodiscover URL.

This server can be an Exchange installed on your company's premises (on-premises) or a Hosted Exchange OVHcloud solution. A Hosted Exchange solution is not hosted on the Office 365 / Microsoft 365 servers: it is an Exchange server hosted on the OVHcloud servers.

Outlook then queries Office 365, assuming the mailbox is in the Microsoft cloud, instead of first checking the Exchange OVHcloud server's autodiscover. This triggers the repeated Microsoft sign-in windows.

When you add the account, this automatic settings lookup (autodiscover) is visible at the "Searching for your mail server settings" step:

Outlook wizard searching for the mail server settings when adding an account

Identifying the symptoms

You are likely affected by this problem if you notice the following:

  • A Microsoft 365 sign-in window appears repeatedly in Outlook and keeps asking for credentials.

  • The message "Tell us the account you want to use to open autodiscover.xml" appears.

    Microsoft 365 sign-in window in Outlook asking for the account to open autodiscover.xml
  • The window persists after restarting Outlook or creating a new Outlook profile.

  • The mailbox is nonetheless correctly hosted on Exchange OVHcloud and the OVHcloud autodiscover is correctly configured.

  • A red error message "This username may be incorrect…" may appear when the account you entered is not recognised by the Microsoft 365 tenant.

    Red error message 'This username may be incorrect' in the Microsoft sign-in window

Checking that the mailbox is hosted on Exchange OVHcloud

Before applying the fix, check that the OVHcloud-side configuration is correct:

If the OVHcloud configuration is correct but the sign-in windows persist, the cause is on the client side: Outlook favours the Office 365 endpoint.

Identifying the cause

This behaviour is triggered in 2 main situations:

  • The domain name has been declared on an Office 365 tenant. When you add a domain to a Microsoft 365 tenant, Microsoft assumes that the mailboxes for that domain are in the cloud. Outlook then connects to the Office 365 autodiscover instead of the OVHcloud one.
  • An identical account has been created in Office 365. If a mailbox or user with the same email address (or the same UPN) exists in a Microsoft 365 tenant, Outlook may be redirected to that cloud account rather than to your Exchange OVHcloud account.
Tip

If you no longer use Office 365 for this domain, also consider removing the relevant domain or account from the Microsoft 365 tenant. The fix below remains necessary, however, as long as Outlook continues to favour the Office 365 endpoint.

Applying the fix: the ExcludeExplicitO365Endpoint registry key

To prevent Outlook from using the explicit Office 365 endpoint during autodiscover, add a registry key on the client computer.

Warning

Editing the Windows registry is a sensitive operation. A mistake can prevent the system or applications from working correctly. We recommend backing up the registry before making any changes.

Using the Registry Editor

  1. Open the Registry Editor (regedit) in the session of the affected user on the client computer.

    Windows search showing the Registry Editor application and the Run as administrator option
  2. Go to the following key. If the AutoDiscover subkey does not exist, create it:

HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\AutoDiscover

The version number 16.0 corresponds to Outlook 2016, 2019, 2021 and Microsoft 365.

  1. Create a new DWORD (32-bit) value, name it ExcludeExplicitO365Endpoint and set its value to 1.
  2. Close the Registry Editor.
Windows Registry Editor showing the ExcludeExplicitO365Endpoint value set to 1

Using the command line

You can also add the key with a single command in a command prompt:

reg add HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\AutoDiscover /t REG_DWORD /v ExcludeExplicitO365Endpoint /d 1
Warning

On Windows 11 with Office 2024 LTSC (and, more broadly, on recent versions), the AutoDiscover key is no longer in the system context but in the context of the logged-in user. Therefore, launch the Registry Editor (or the command prompt) in the session of the affected user, not as an administrator of another account.

Checking the connection to Exchange OVHcloud

Start Outlook and check that the Microsoft 365 sign-in window no longer appears. Outlook now connects directly to your Exchange OVHcloud server rather than to Office 365 / Microsoft 365.

There is no need to recreate the Outlook profile after adding the registry key.

To confirm the connection, open classic Outlook and look at the status bar at the bottom of the window: it should display Connected to: Microsoft Exchange. Outlook is then communicating with your Exchange OVHcloud server, and no longer with Office 365:

Classic Outlook interface with the status bar showing 'Connected to: Microsoft Exchange' at the bottom of the window

To check the exact server name (ex?.mail.ovh.netThe ? represents your Exchange OVHcloud server number (for example ex1, ex2, ex3…), which varies depending on the infrastructure hosting your mailbox.), hold down the Ctrl key and right-click the Outlook icon in the Windows notification area, then select Connection Status.

Danger

If you plan to migrate mailboxes to Office 365 / Exchange Online later, remember to delete the ExcludeExplicitO365Endpoint registry key. As long as it is present, it prevents Outlook from connecting to Exchange Online.

Go further

Info

For more information about the autodiscover feature and Outlook configuration, see the Microsoft help centre.

Exchange - Configure your email account on classic Outlook for Windows

Using the Exchange error diagnostic

Add a domain name to your Exchange service

Join our community of users.

Was this page helpful?