Merging mailbox EO from AAD with local domain account

drClays 151 Reputation points
2022-10-14T10:35:41.387+00:00

Hi everyone,

I have a tenant in EO with 50 mailbox accounts. Now I want to connect local AD with AAD via Azure AD Connect.

How to merge correctly AAD account with local AD where users can use the mailbox via local AD credentials?

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,194 questions
Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Microsoft Security | Microsoft Entra | Other
{count} votes

Accepted answer
  1. Vasil Michev 119.9K Reputation points MVP Volunteer Moderator
    2022-10-14T11:40:49.44+00:00

    You have two options when it comes to "matching" on-premises accounts with AAD ones:

    1) Soft-match, based on the PrimarySMTPAddress value is generally the easiest option. It does have some prerequisites though, so make sure you cover all the details as listed here: https://support.microsoft.com/en-us/topic/how-to-use-smtp-matching-to-match-on-premises-user-accounts-to-office-365-user-accounts-for-directory-synchronization-75673b94-e1b8-8a9e-c413-ee5a2a1a6a78
    2) Hard-match, based on the objectGUID (or generally speaking the sourceAnchor, which can also be set as the value of mS-DS-ConsistencyGuid). This is a bit more complicated as it requires you to calculate and populate the ImmutableId value. Here's an example:

    Get-ADUser -Filter * | select UserPrincipalName,ObjectGUID,@{n="ImmutableID";e={[System.Convert]::ToBase64String($_.ObjectGUID.tobytearray())} } | export-csv -nti C:\immutableID.csv  
    
    $csv = import-csv C:\immutableID.csv  
    $csv | ? {$_.UserPrincipalName -ne ""} | % { Set-MsolUser -UserPrincipalName $_.UserPrincipalName -ImmutableId $_.ImmutableID}  
    
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Andy David - MVP 157.8K Reputation points
    2022-10-14T11:31:00.023+00:00
    0 comments No comments

  2. drClays 151 Reputation points
    2022-10-18T10:07:47.797+00:00

    Thanks all for your reply, I'll check all of it this week and back here with answer or other questions.

    0 comments No comments

  3. drClays 151 Reputation points
    2022-11-28T19:16:50.187+00:00

    Hi @Vasil Michev & @Andy David - MVP ,

    sorry for the delayed answer.

    I try to use soft merging (SMTP merge) but I had errors in AADC.

    I have got an Azure AD account "martin.john@Company portal .com" with a Bussines Standard license, in Local AD I create an account with SAMA "martin.john" and add to the attribute proxyAddresses: "SMTP:martin.john@Company portal .com" then when it trying to sync I have error:

    264903-2022-11-28-20h01-07.png

    Next, I create an account with SAMA "m.john" in Local AD with the attribute proxyAddresses: "SMTP:martin.john@Company portal .com" and it's sync correctly, but when I tried to change the license from AAD account "martin.john" to synchronized "m.john" I've got this:

    Uniqueness constraint violation.

    Any suggestions?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.