How to disable Microsoft Entra Connect sync and convert a user account to cloud only‎

Vishnu Anand 300 Reputation points
2025-12-19T10:54:48.49+00:00

Earlier, we had tested an on-premises setup, which was handled by one of my colleagues. That setup has since been removed. However, Microsoft Entra Connect synchronization is still showing as enabled, and when trying to modify user settings, we receive the error: "This user is synchronized with your local Active Directory. Some details can be edited only through your local Active Directory."

found the commands below to disable this option. Is it safe to follow these steps, or could this cause any issues with the tenant and the user account?

Get your tenant ID: $orgId = (Get-MgOrganization).Id
Disable synchronization: $params = @{ onPremisesSyncEnabled = $false }
Update-MgOrganization -OrganizationId $orgId -BodyParameter $params
Verify: Get-MgOrganization | Select DisplayName, OnPremisesSyncEnabled
Microsoft Security | Microsoft Entra | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Marcin Policht 103.6K Reputation points MVP Volunteer Moderator
    2025-12-19T11:56:28.72+00:00

    Confirmed - this is part of the official documentation provided by Microsoft:

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

    Turn off directory synchronization

    To turn off directory synchronization:

    First, install the required software and connect to your Microsoft 365 subscription. For instructions, see Connect with the Microsoft Graph PowerShell module for Windows PowerShell.

    Use Update-MgOrganization to disable directory synchronization:

    PowerShell

      # Install v1.0 and beta Microsoft Graph PowerShell modules 
      Install-Module Microsoft.Graph -Force
      Install-Module Microsoft.Graph.Beta -AllowClobber -Force 
      
      # Connect With Hybrid Identity Administrator Account
      Connect-MgGraph -scopes "Organization.ReadWrite.All,Directory.ReadWrite.All" 
      
      # Verify the current status of the DirSync Type
      Get-MgOrganization | Select OnPremisesSyncEnabled 
      
      # Store the Tenant ID in a variable named organizationId
      $organizationId = (Get-MgOrganization).Id 
      
      # Store the False value for the DirSyncEnabled Attribute
      $params = @{
      	onPremisesSyncEnabled = $false
      }
      
      # Perform the update
      Update-MgOrganization -OrganizationId $organizationId -BodyParameter $params 
      
      # Check that the command worked
      Get-MgOrganization | Select OnPremisesSyncEnabled
    

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

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