How to Fully Remove Microsoft Azure AD Connect


How to Fully Remove Microsoft Azure AD Connect

Microsoft Azure AD Connect

Microsoft’s Azure AD Connect is a great tool that allows admins to sync Active Directory credentials from local domain environments with Microsoft’s cloud (Azure/Office 365), eliminating the need for users to maintain separate passwords for each.

While not a common occurrence, there may be reasons that you would need to remove Microsoft’s Azure AD Connect utility from your environment. This can be achieved in a few short steps and involves both removal from the local domain environment as well as deactivating the service in the cloud.

Step 1

Open PowerShell (Run as Administrator).

Step 2

Install Microsoft Online module for Azure Active directory using the following command:

Install-Module -Name MSonline

If prompted to continue, input “Y” and press enter. Any subsequent confirmations can be accepted by inputting “A” for “Yes to All” and pressing Enter.

Step 3

Input login credentials using the following PowerShell command:

$msolcred = get-credential

You will be prompted to authenticate. Use the global administrator account within your Office 365 tenant (ex. and the corresponding password.

Step 4

Initiate Connection to Office 365 using the following PowerShell command:

connect-msolservice -credential $msolcred

Step 5

Keep this PowerShell instance open, we will use it in later steps.

Step 6

Uninstall Azure AD Connect application (and services) from your local domain environment using Control Panel.Uninstall Microsoft Azure AD Connect

Step 7

Once you have AD Connect uninstalled, you will still need to disable the service through office 365. To do so, use the following PowerShell command.

Set-MsolDirSyncEnabled -EnableDirSync $false

You will be prompted to confirm, press Y to confirm and then press Enter.


Step 8

To verify that directory sync was fully disabled, use the following PowerShell command:


A returned value of False will validate the deactivation.

Need to Reenable AD Connect?

If you ever need to reenable AD Connect, repeat the PowerShell procedures above and use the following command in place of step 7:

Set-MsolDirSyncEnabled -EnableDirSync $true

Please note depending on the size of your AD environment, you may have to wait several hours before Microsoft will allow you to reactivate. You can then reinstall and configure Azure AD Connect in your environment.

KeepWatch by InterWorks

Whether you need support for one platform or many, our technical experts have you covered.

More About the Author

Marshall Roy

IT Lead
Email Security at Its Finest Today more than ever, IT is in a place where admins must be steps ahead of the bad guys. Email systems are one of the areas that is at ...
The Importance of Maintaining Your IT Infrastructure We get it, your workload is busier than ever. Between trouble tickets, meetings, projects, ongoing training goals and trying to squeeze ...

See more from this author →

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK


Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Geschäftsführer: Mel Stephenson

Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072


Love our blog? You should see our emails. Sign up for our newsletter!