Microsoft Online - How to remove duplicated users
Overview
This KB overviews how to resolve a user being duplicated by the Azure AD User sync within the Microsoft Online service in Atria.
There is a couple of ways to see how this is occuring
1. Two Users with the same name appear on the search
2. There are duplicate users in Active Directory
3. There is a user missing from Atria who was previously there, and appears on the search.
The reason why the users do not appear on User list is because two users are not shown if they have the same Primary Email Address. To make them appear on the UI, change the primary email address of the invalid user directly in AD for them both to appear.
Applies To
Any version before Atria 15.2 - This has been fixed to handle this scenario and tie the users correctly in 15.2.
Procedure
1. On your SQL database - query the DUPLICATE user and grab it's userID (example:
select userid, name,label, upn from users where label = 'Joan Lee')
2. Execute the stored procedure to delete this duplicate user (exec sp_UsersDelete @userid=788)
3. Validate that the duplicate user was removed including the associated service
select userid, name,label, upn from users where label = 'Joan Lee'
select * from UserServices where userid=788
4. Now that this is cleared in Atria, navigate to PartnerCenter and update the user's username. Wait this update to propagate into Office365
NOTE: it is really required that UPN matches on both sides.
5. Once the update is done, it should reflect the changes in Office365 Admin
6. Double check the e-mail addresses in Exchange Online to make sure all are still intact- make changes if necessary
7. Run the Sync Tenant in Atria. This will now match the user and sync it properly and provision MSOL
8. Validate this user
9. Lastly, on your AD - delete the duplicate user account that was created