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

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

1 thought on “How to Remove Microsoft Azure AD Connect using PowerShell

Leave a Reply

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