Adding domain to Office 365 caused outlook to point to office 365 instead of on-premises exchange

%3CLINGO-SUB%20id%3D%22lingo-sub-1680108%22%20slang%3D%22en-US%22%3EAdding%20domain%20to%20Office%20365%20caused%20outlook%20to%20point%20to%20office%20365%20instead%20of%20on-premises%20exchange%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1680108%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20have%20the%20following%20situation%20and%20need%20an%20advice%20please%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E*%20We%20have%20office%20365%20account%20for%20using%20Microsoft%20Apps%20with%2080%20users%20added%20to%20it%20with%20abc.onmicrosoft.com%20domain.%3C%2FP%3E%3CP%3E*%20We%20have%20Exchange%202013%20server%20on%20premise%20with%20our%20abc.net%20domain%20with%20the%20same%20usernames%20available%20on%20office%20365%20admin%20center.%3C%2FP%3E%3CP%3E*%20We%20added%20our%20abc.net%20domain%20to%20the%20admin%20center%20as%20a%20second%20domain%20so%20that%20the%20users%20can%20access%20Teams%2C%20One%20drive%20and%20other%20Apps%20using%20the%20same%20email%20address%26nbsp%3B%40abc.net%20instead%20of%20%40abc.onmicrosoft.com.%20The%20license%20is%20Microsoft%20Business%20Standard.%26nbsp%3B%3C%2FP%3E%3CP%3E*%20Everything%20went%20fine%20at%20the%20beginning%20and%20then%20outlook%20started%20pointing%20to%20the%20office365%20accounts%20instead%20of%20the%20on%20premise%20Exchange%20server%20although%20when%20the%20domain%20added%2C%20the%20option%20of%20not%20connecting%20the%20services%20was%20selected.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eis%20there%20a%20way%20to%20use%20the%20same%20domain%20and%20keep%20services%20separated%3F%3C%2FP%3E%3CP%3Ethank%20you%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1680108%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eadding%20second%20domain%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1680191%22%20slang%3D%22en-US%22%3ERe%3A%20Adding%20domain%20to%20Office%20365%20caused%20outlook%20to%20point%20to%20office%20365%20instead%20of%20on-premises%20exchang%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1680191%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F797768%22%20target%3D%22_blank%22%3E%40atirhi%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%2C%20when%20you%20added%20your%20domain%20to%20O365%2C%20did%20you%20change%20your%20MX%20records%20or%20autodiscover%20records%3F%26nbsp%3B%20This%20would%20have%20the%20effect%20you%20are%20seeing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20you%20would%20need%20to%20do%20to%20achieve%20what%20you%20are%20looking%20for%20is%20configure%20hybrid%20coexistence%20between%20your%20on%20premises%20AD%20and%20Azure%20AD.%26nbsp%3B%20This%20will%20allow%20you%20to%20use%20your%20domain%20both%20on-premises%20and%20in%20the%20cloud%2C%20but%20keep%20the%20Teams%20and%20Exchange%20services%20separate.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20you%20will%20have%20to%20be%20careful%20of%20is%20duplicate%20email%20accounts.%26nbsp%3B%20You%20may%20now%20find%20that%20your%20users%20have%20a%20mailbox%20on-premises%20and%20also%20in%20the%20cloud.%26nbsp%3B%20Another%20complication%20if%20this%20is%20the%20case%2C%20is%20that%20Teams%20uses%20the%20Exchange%20Online%20mailbox%20to%20store%20information.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20have%20no%20significant%20info%20stored%20in%20Teams%20just%20yet%2C%20then%20the%20easiest%20potential%20solution%20to%20this%20may%20be%20to%20delete%20these%20cloud%20accounts.%26nbsp%3B%20If%20you%20find%20you%20have%20important%20business%20data%20stored%20in%20these%20cloud%20accounts%2C%20it%20becomes%20more%20difficult%2C%20and%20you%20will%20need%20to%20go%20through%20a%20process%20to%20match%20the%20accounts%20together.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1680193%22%20slang%3D%22en-US%22%3ERe%3A%20Adding%20domain%20to%20Office%20365%20caused%20outlook%20to%20point%20to%20office%20365%20instead%20of%20on-premises%20exchang%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1680193%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F616707%22%20target%3D%22_blank%22%3E%40PeterRising%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethank%20you%20very%20much.%20I%20didn't%20change%20the%20MX%20records%2C%20I%20just%20added%20the%20TXT%20record%20for%20verification.%20That's%20why%20I'm%20confused%20of%20why%20outlook%20switched%20to%20the%20cloud%20accounts.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1680215%22%20slang%3D%22en-US%22%3ERe%3A%20Adding%20domain%20to%20Office%20365%20caused%20outlook%20to%20point%20to%20office%20365%20instead%20of%20on-premises%20exchang%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1680215%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F797768%22%20target%3D%22_blank%22%3E%40atirhi%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHmm%2C%20that%20is%20odd.%26nbsp%3B%20Autodiscover%20record%20definitely%20not%20pointing%20to%20autodiscover.outlook.com%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20M365%20licences%20have%20you%20assigned%20to%20the%20cloud%20users%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1680216%22%20slang%3D%22en-US%22%3ERe%3A%20Adding%20domain%20to%20Office%20365%20caused%20outlook%20to%20point%20to%20office%20365%20instead%20of%20on-premises%20exchang%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1680216%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F616707%22%20target%3D%22_blank%22%3E%40PeterRising%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMicrosoft%20365%20Business%20Standard%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1680226%22%20slang%3D%22en-US%22%3ERe%3A%20Adding%20domain%20to%20Office%20365%20caused%20outlook%20to%20point%20to%20office%20365%20instead%20of%20on-premises%20exchang%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1680226%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F797768%22%20target%3D%22_blank%22%3E%40atirhi%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESorry%2C%20you%20did%20say%20that%20in%20your%20original%20post.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOK%2C%20that%20is%20baffling%20if%20you've%20only%20verified%20ownership%20of%20the%20domain%20with%20the%20TXT%20record%20but%20changed%20no%20other%20DNS%20settings.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhenever%20something%20like%20this%20occurs%2C%20it's%20always%20inevitably%20DNS.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1680388%22%20slang%3D%22en-US%22%3ERe%3A%20Adding%20domain%20to%20Office%20365%20caused%20outlook%20to%20point%20to%20office%20365%20instead%20of%20on-premises%20exchang%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1680388%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F797768%22%20target%3D%22_blank%22%3E%40atirhi%3C%2FA%3E%26nbsp%3BI%20just%20see%20this%20post%20by%20coincidence%2C%20we%20had%20such%20migration%20as%20well%20and%20had%20the%20same%20issue%20as%20you%20have%20experienced%20with%20around%20100%20users.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EAs%20far%20as%20we%20have%20understood%2C%20this%20is%20due%20to%20Outlook's%20Direct%20Connect%20feature%20which%20checks%20against%20Exchange%20Online%20by%20default%20and%20bypasses%20regular%20AutoDiscovery%20if%20a%20verified%20domain%20is%20found.%20If%20your%20users%20also%20have%20an%20Exchange%20Online%20license%20(e.g.%20if%20you%20are%20using%20Teams%20Exploratory%20licenses%20or%20M365%20Business%2C%20these%20are%20applied%20by%20default)%20your%20users%20already%20have%20an%20additional%20cloud%20only%20mailbox.%20So%20Outlook%20finds%20two%20mailboxes%20and%20is%20kinda%20confused.%26nbsp%3B%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.gothamweb.com%2Fportal%2Findex.php%2Fknowledgebase%2F8%2FOutlook-bypasses-AutoDiscover-and-connects-directly-to-Office-365-mailbox.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.gothamweb.com%2Fportal%2Findex.php%2Fknowledgebase%2F8%2FOutlook-bypasses-AutoDiscover-and-connects-directly-to-Office-365-mailbox.html%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EYou%20can%20remove%20all%20Exchange%20Online%20licenses%20of%20your%20users%20or%20continue%20with%20a%20proper%20Exchange%20Hybrid%20deployment.%26nbsp%3BAlternatively%20you%20can%20set%20the%20following%20reg%20setting%20on%20all%20clients%20in%20order%20to%20suppress%20this%20behavior.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3E%5BHKEY_CURRENT_USER%5CSoftware%5CMicrosoft%5COffice%5C16.0%5COutlook%5CAutoDiscover%5D%0AExcludeExplicitO365Endpoint%3Ddword%3A00000001%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Dear All,

 

i have the following situation and need an advice please:

 

* We have office 365 account for using Microsoft Apps with 80 users added to it with abc.onmicrosoft.com domain.

* We have Exchange 2013 server on premise with our abc.net domain with the same usernames available on office 365 admin center.

* We added our abc.net domain to the admin center as a second domain so that the users can access Teams, One drive and other Apps using the same email address @abc.net instead of @abc.onmicrosoft.com. The license is Microsoft Business Standard. 

* Everything went fine at the beginning and then outlook started pointing to the office365 accounts instead of the on premise Exchange server although when the domain added, the option of not connecting the services was selected.

 

is there a way to use the same domain and keep services separated?

thank you

 

17 Replies
Highlighted

@atirhi 

 

Hi, when you added your domain to O365, did you change your MX records or autodiscover records?  This would have the effect you are seeing.

 

What you would need to do to achieve what you are looking for is configure hybrid coexistence between your on premises AD and Azure AD.  This will allow you to use your domain both on-premises and in the cloud, but keep the Teams and Exchange services separate. 

 

What you will have to be careful of is duplicate email accounts.  You may now find that your users have a mailbox on-premises and also in the cloud.  Another complication if this is the case, is that Teams uses the Exchange Online mailbox to store information.

 

If you have no significant info stored in Teams just yet, then the easiest potential solution to this may be to delete these cloud accounts.  If you find you have important business data stored in these cloud accounts, it becomes more difficult, and you will need to go through a process to match the accounts together.

Highlighted

@PeterRising 

 

thank you very much. I didn't change the MX records, I just added the TXT record for verification. That's why I'm confused of why outlook switched to the cloud accounts.

 

thanks

Highlighted

@atirhi 

 

Hmm, that is odd.  Autodiscover record definitely not pointing to autodiscover.outlook.com?

 

What M365 licences have you assigned to the cloud users?

 

Highlighted
Highlighted

@atirhi 

 

Sorry, you did say that in your original post.  

 

OK, that is baffling if you've only verified ownership of the domain with the TXT record but changed no other DNS settings.

 

Whenever something like this occurs, it's always inevitably DNS.

Highlighted

@atirhi I just see this post by coincidence, we had such migration as well and had the same issue as you have experienced with around 100 users. 

As far as we have understood, this is due to Outlook's Direct Connect feature which checks against Exchange Online by default and bypasses regular AutoDiscovery if a verified domain is found. If your users also have an Exchange Online license (e.g. if you are using Teams Exploratory licenses or M365 Business, these are applied by default) your users already have an additional cloud only mailbox. So Outlook finds two mailboxes and is kinda confused. 
https://www.gothamweb.com/portal/index.php/knowledgebase/8/Outlook-bypasses-AutoDiscover-and-connect...


You can remove all Exchange Online licenses of your users or continue with a proper Exchange Hybrid deployment. Alternatively you can set the following reg setting on all clients in order to suppress this behavior.

 

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\AutoDiscover]
ExcludeExplicitO365Endpoint=dword:00000001

 

 

Highlighted

@burningice 

 

thank you very much. This is exactly what is happening. I will try the solution, but changing the registry record could be time consuming with staff at several places. Any ideas to auto deploy it?

 

thank you.

 

Highlighted
Easiest way is to create a GPO with this reg setting and apply it to your users.

If you want to remove the licenses, it depends how your infrastructure is built, do you already have Azure AD Connect established?
If yes, I would create a new Security Group like "M365 Business" and apply it to all affected users. Then in M365 admin console, remove every license assignment to you users. Instead use this newly created AD group and assign the M365 license to the group, there you can remove Exchange Online plan for the whole group at once. After this is processed, all users have this predefined set of licenses.

If you have no AAD sync in place, you can either start with this, but then you might face other issues during initial sync as the local AD users might not map with the already existing cloud users and result in a mess - we had assistance from a certified partner for this step. Then it might be the fastest to to click though every user and remove the Exchange Online plan manually..

Highlighted

@burningice 

 

thank you. we don't have AAD. Will do a manual test. Last question: Will updating office applications in the future reset the registry record again?

 

thanks again

Highlighted

@burningice 

 

Well I have learned something here I must admit.  I had no idea about this quirk.  Thank you for sharing this knowledge!  :smile:

Highlighted

@atirhi as far as I know, this reg setting is not overwritten if Office updates. 

also, if you once get a proper Exchange Hybrid Environment with Azure Ad Sync and stuff, you don't have to remove the setting . If there is only one distinct Cloud mailbox per user, Outlook will happily use it

Highlighted
Highlighted

@PeterRising 

 

me too.. thanks to both of you as i have learned a lot.

 

have a nice day

Highlighted

@PeterRising you're welcome :)

 

When I read this post, I had flashbacks to our own environment when the phone started ringing just after verifying the domain... 
If your tenant starts from scratch and you have no already existing users in Azure AD, you will not notice anything. It only becomes tricky if a user also has a separate cloud identity with a separate mailbox 

Highlighted

@burningice 

 

Hi again,

 

i was looking into the issue with the registry record and found a second solution which I'm not sure if it will work or not here:

 

https://medium.com/jj365/outlook-issue-with-direct-connect-to-office365-352dd29de65

 

will disabling MAPI on exchange online works?

thanks

 

Highlighted

@atirhi I have no personal experience with this solution - if it works for you, go for it :smile:

 

However I am no fan of messing with some Exchange Server settings just to workaround some issue caused by a not supported architecture. The primary issue is that there are two mailboxes per affected user. Therefore I would suggest to remove the Exchange Online mailbox by disabling the license for the users. 

Highlighted

@burningice 

 

thanks. I will go with the registry solution. Disabling the online mailbox will remove the calendar from Teams application which is needed by the staff.

 

thanks again