Outlook and Windows is now set to connect to Office 365 instead of your on-premises or PIP hosted Exchange server due to Microsoft’s changes to the Autodiscover service. The Autodiscover service is the feature that tells your Outlook Client where your mailbox resides and automatically configures the settings. When you start Outlook, it checks for a series of potential configurations, starting with Office 365. If your Office 365 account is discoverable, Outlook will connect to it before discovering your real Email address. Therefore ff you have the same email address for Office 365 and your external Email server, Outlook will default to the Office 365 account.
To resolve this issue, you can modify your registry settings to exclude Office 365 as an Autodiscover endpoint. This will force Outlook to skip the Office 365 check and connect directly to your Email Server. However, please be careful when modifying the Registry as any changes could potentially cause your computer to not work properly.
To prevent Outlook from automatically connecting to an Office 365 account, it is best practice ro create a registry entry that excludes your Outlook from detecting Office 365.
Here are the steps:
- Open the Registry Editor by typing `regedit` in the Windows Search or open the run and type `regedit.exe`. If you encounter a prompt asking if you want to allow this device to make changes on your device, click “yes”.
- Navigate to this location in the Registry Editor: `HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\AutoDiscover.
- Create a DWORD (32-bit) value for `ExcludeExplicitO365Endpoint` and change the value to `1` to enable it.
- Restart your computer for the changes to take effect.
- Create a new Outlook Profile by going to the control panel. It should not see the Office 365 mailboxes anymore.
Alternatively, you can also add the registry through Command Prompt or PowerShell:
Command Prompt: `reg add HKEY_CURRENT_USER\Software\Microsoft\Office\x.0\Outlook\AutoDiscover /t REG_DWORD /v ExcludeExplicitO365Endpoint /d 1`
PowerShell: `Set-ItemProperty -Path “HKCU:\Software\Microsoft\Office\16.0\Outlook\AutoDiscover” -Name ‘ExcludeExplicitO365Endpoint’ -Value 1 -Type DWORD –Force`
Please note that these instructions are for Outlook 2016, Outlook 2019 and Outlook 365 and may vary for other versions. Always ensure to back up your registry before making any changes. If you’re not comfortable making these changes, please contact the PIP Helpdesk to make them for you.