How to Remove Microsoft Azure AD Connect using PowerShell

Removal of Microsoft Azure AD connect involves both removal from the local domain environment as well as deactivating the service in the cloud.

  1. Open PowerShell as administrator
  2. Install Microsoft Online module for Azure Active directory:

Install-Module -Name MSonline

When prompted to continue, input “Y”  “A” conveniently.

3. Input your Azure login credentials in a variable:

$msolcred = get-credential

Input global administrator account credentials when prompted

4. Connect the account using the variable we used:

connect-msolservice -credential $msolcred

5. Uninstall Azure AD Connect applications from your local domain environment using Control Panel-> Add Remove Programs

6. Once you have AD Connect uninstalled, disable the Azure AD Connect service:

Set-MsolDirSyncEnabled -EnableDirSync $false

When prompted to confirm, press Y to confirm and then press Enter.

7. Verify the sync status:


This is how, my PowerShell looks once I finish all the steps above


No responses yet

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Comments