Shared Mailbox Getting Removed when User Account is Removed From Azure AD Sync

rr-4098 1,561 Reputation points
2023-06-10T08:33:00.3433333+00:00

We are using Azure AD Connect to sync specific OU's to Azure. Yesterday I received a request to disable a user. Our procedure is to disable the onprem AD account and move it to another OU. Before doing this I converted the user's mailbox to a shared mailbox and removed the license since the mailbox was below 50GB. Anyway after the sync ran it still removed the mailbox. Do I need to set the immutable ID of the user's cloud account to a null value so the property "Is synced from onprem" changes to No?

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,568 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Durkan 12,211 Reputation points MVP
    2023-06-10T12:16:35.7933333+00:00

    Hi

    The sync process will delete the mailbox as even though you have converted to shared, it is still linked via the Immutable ID to the users AD Account.

    You would need to run this command to break the sync:

    Set-MSOLUser -UserPrincipalName user@yourdomain.com -ImmutableID "$null"

    Then restore the Shared Mailbox from the Deleted Users section of M365

    Hope this helps,

    Thanks

    Michael Durkan

    • If the reply was helpful please upvote and/or accept as answer as this helps others in the community with similar questions. Thanks!
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. rr-4098 1,561 Reputation points
    2023-06-11T08:32:59.4+00:00

    Thank you for the great feedback. Should I enable syncing of the account or just restore it then run the command you listed?

    0 comments No comments

  2. Michael Durkan 12,211 Reputation points MVP
    2023-06-11T09:37:38.93+00:00

    Hi

    No need to re-sync - once you restore the mailbox it will show as cloud-only. Run the command from your Azure AD Connect server.

    Thanks

    Michael Durkan

    • If the reply was helpful please upvote and/or accept as answer as this helps others in the community with similar questions. Thanks!

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.