Turn off directory synchronization for Microsoft 365

丁 銘威 25 Reputation points
2025-05-20T02:34:17.3266667+00:00

In my current environment, local AD users, groups, and contacts are synchronized to 365 through the Azure AD connect tool.

If I want to permanently turn off directory synchronization for Microsoft 365, so that all users, groups, and contacts are cloude only, follow Microsoft's documentation

https://learn.microsoft.com/en-us/microsoft-365/enterprise/turn-off-directory-synchronization?view=o365-worldwide#turn-off-directory-synchronization

There is a description that says you must first remove Azure AD connect tool and then issue the command to turn off synchronization. But I have a question, if I remove Azure AD Connect first, will the users and groups on M365 disappear or be deleted?

Microsoft Security Microsoft Entra Microsoft Entra ID
{count} votes

Accepted answer
  1. Jinnie Nguyen 310 Reputation points Independent Advisor
    2025-05-20T09:43:12.3833333+00:00

    Hello,

    Thank you for your question about permanently turning off directory synchronization for Microsoft 365 and your concern about removing the Azure AD Connect tool first. I’ll guide you through the process following Microsoft’s documentation and address your concern about users and groups.

    Instructions to Turn Off Directory Synchronization:

    1. Uninstall Azure AD Connect (Recommended First Step):

    • On the server where Azure AD Connect is installed, go to Control Panel > Programs and Features.
    • Find Microsoft Azure AD Connect, select it, and click Uninstall.
    • Action: Follow the prompts to remove the tool completely.

    2. Install Microsoft Graph PowerShell Modules:

    Open PowerShell as an administrator and run:

    Install-Module Microsoft.Graph -Force

    Install-Module Microsoft.Graph.Beta -AllowClobber -Force

    3. Connect to Microsoft Graph:

    Use a Hybrid Identity Administrator account

    Connect-MgGraph -scopes "Organization.ReadWrite.All,Directory.ReadWrite.All"

    4. Verify Current Sync Status:

    • Run:

    Get-MgOrganization | Select OnPremisesSyncEnabled

    • Confirm it shows True.

    5. Disable Directory Synchronization:

    • Store the tenant ID and disable sync::

    $organizationId = (Get-MgOrganization).Id

    $params = @{ onPremisesSyncEnabled = $false }

    Update-MgOrganization -OrganizationId $organizationId -BodyParameter $params

    -Verify the change:

    Get-MgOrganization | Select OnPremisesSyncEnabled

    It should now show False.

    Will Users and Groups Disappear After Removing Azure AD Connect?

    No, removing Azure AD Connect first does not delete users, groups, or contacts in Microsoft 365. These objects remain in the cloud, but their source of authority stays tied to the on-premises AD until synchronization is disabled. Once you run the Update-MgOrganization command, all synchronized objects (users, groups, contacts) are converted to cloud-only, meaning their source of authority shifts to Microsoft Entra ID. This process preserves all objects, and they will not be deleted. Passwords remain the last synchronized value, and the ImmutableID is retained for potential future re-sync (after a 72-hour wait period).

    Additional Notes:

    • Microsoft recommends uninstalling Azure AD Connect before disabling sync to avoid portal inconsistencies (e.g., Password Hash Sync showing as enabled). However, even if you disable sync first, objects are not deleted—they just stop syncing.
    • Wait up to 72 hours for the Microsoft 365 admin center to reflect the change (users will show as "In-cloud").
    • If you need to re-enable sync later, you must wait 72 hours after disabling.

    If you encounter issues, open a ticket via Microsoft 365 admin center > Help & support.

    Best,


    If I have answered your question, please accept this as answer as a token of appreciation and don't forget to thumbs up for "Was it helpful"!

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2025-05-20T06:48:21.43+00:00

    No, it will not result in deleting the objects, but it's also not a required step, just recommended for some scenarios. You can ignore it and disable synchronization without uninstalling the tool.

    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.