Forum Discussion
tomwrigglesworth
Aug 05, 2024Copper Contributor
Merge user account on-prem and 365 account using Powershell
Hello,
We have a user called dan claton who has an on-prem AD username of Dclayton and was not in the sync OU. A technician then created a O365 account for a mailbox dan.clayton@ and this has now been used for over two years.
Can we merge these entries so the user signs in with the on-prem details but still uses the O365 licence and mailbox?
- You might have to use the "hard match" method instead, see https://www.michev.info/blog/post/6129/how-to-hard-match-entra-id-users-via-the-graph-api-or-the-graph-sdk-for-powershell
You may create a local AD object with an SMTP address that matches primary SMTP address in O365, this can ensure synchronization between on-premises AD and Azure AD.
- tomwrigglesworthCopper ContributorThat's what we first tried but it just comes up with a duplicate error in O365.
- You might have to use the "hard match" method instead, see https://www.michev.info/blog/post/6129/how-to-hard-match-entra-id-users-via-the-graph-api-or-the-graph-sdk-for-powershell