How to Merge User accounts in Office 365 with on-premise User accounts

While working with one of the customer who was already using office 365 for office proplus services but was having all user ids for example as

Now they are ready for synchronization with their on premise infrastructure but don’t want duplicate ids to be created so here are the summary of steps that needs to be done so that user accounts are merged.

  • ADD a domain to office365 installation by following ADD domain wizard, example

Go to office 365 admin console –> Settings –> Domains –> ADD Domain


This will ask you to create a TXT record in the DNS for


Value: MS=code for authorization

TTL: 3600 or provider default

This record assists Microsoft to check the authorization of the domain, this will not change any of the services that are already running in the environment so just create it.

Note: First You have to change the on-premise users UPN to Primary SMTP address, before synchronization of Active Directory to the cloud.

Ones the domain is added you need to change the UPN of Cloud user to match the UPN of on-premise user i.e. Primary SMTP address.

As UPN matches on both locations  so ones you synchronize AD by using Azure AD connect  display Sync Type will change from In cloud  to synced with Active directory as shown below.


Tech Wizard



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s