Delete AD connect without access to server

Jason Dale 1 Reputation point
2022-09-19T05:49:47.833+00:00

I have been messing around with adding a local server but was running the Server 2019 with a VM that has died. It has SSO setup through azure and wish to delete it as i get emails every day about failed syncs. Thanks for any help.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Vasil Michev 119.8K Reputation points MVP Volunteer Moderator
    2022-09-19T06:18:29.853+00:00

    You can disable synchronization from the service side by running:

    Set-MsolDirSyncEnabled -EnableDirSync $false  
    

    If you want to make any further changes, it's best to spin up another instance of Azure AD connect and rerun the config wizard.


  2. Charlie Dancoisne 0 Reputation points
    2025-07-04T13:37:42.3966667+00:00

    If you've lost access to your Azure AD Connect server (for example, due to a failed VM), you can disable directory synchronization directly from the cloud using Microsoft Graph PowerShell — no need for the deprecated MSOnline module.

    Here’s the PowerShell sequence I successfully used in July 2025 on a production tenant:

    Install-Module Microsoft.Graph -Scope CurrentUser -Force;
    Connect-MgGraph -Scopes "Organization.ReadWrite.All";
    $org = Get-MgOrganization;
    Update-MgOrganization -OrganizationId $org.Id -OnPremisesSyncEnabled $false;
    Get-MgOrganization | Select-Object OnPremisesSyncEnabled; # --> $null
    

    OnPremisesSyncEnabled = $null confirms the sync flag has been cleared.

    It may take up to 72 hours for the change to fully propagate and for all objects to switch to "cloud-only" status. No need to install the beta module — this worked using the stable Microsoft.Graph release.

    0 comments No comments

  3. Charlie Dancoisne 0 Reputation points
    2025-07-04T13:43:07.4066667+00:00

    . . . . . .

    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.