Microsoft Azure/Entra AD Connect Uninstallation
Uninstalling Microsoft Azure AD Connect is essential for organizations. This guide focuses on PowerShell's key role, detailing module installation, synchronization status checks, disabling, and uninstalling. It emphasizes manual cleanup in Control Panel, File Explorer, user directories, and ADSync service account removal for a thorough uninstallation.

Microsoft Azure AD Connect is a vital tool for organizations that aim to synchronize their on-premises Active Directory with Microsoft 365. However, there are situations where uninstallation becomes necessary. In the below steps, we'll explore the steps involved in uninstalling AD Connect, emphasizing the use of PowerShell and the importance of thorough removal.
First step, Uninstalling AD Connect with PowerShell:
Uninstalling AD Connect directly from the Programs and Features menu may leave remnants on the system. To ensure a clean uninstallation, PowerShell comes to the rescue. Follow these steps:
Install the MSOnline Module: Open PowerShell as an administrator and install the MSOnline module using the following command:
Install-Module -Name MSonline
Connect PowerShell with MSOLService: Connect to MSOLService using your M365 Global Admin credentials:
Connect-msolservice
Check Sync Status: Verify the synchronization status using the following command:
(Get-MSOLCompanyInformation).DirectorySynchronizationEnabled
Disable Synchronization: Disable the synchronization service with the following command:
Set-MsolDirSyncEnabled -EnableDirSync $false
Second step, After Disabled the AD Connect with PowerShell need to remove the Tool from Programme & need to remove some folders from File Explorer
Open Control Panel:
Open the Control Panel and navigate to Programs and Features (appwiz.cpl). Uninstall the following components:
- Microsoft Azure AD Connect
- Microsoft Azure AD Connect Agent Updater
- Microsoft Azure AD Connect Synchronization Services
File Explorer Cleanup: Go to File Explorer ‘C’ Drive & navigate to the "Program Files" directory and delete the specified folders associated with AD Connect.
User Directory Cleanup: In File Explorer, go to the ‘C’ Drive & go to the "User" directory, and delete the AD Sync file as indicated.
Confirm Services Removal: Open the Run dialog (Windows+R) and type services.msc. Confirm that the "Microsoft Azure AD Sync" and "Microsoft Azure AD Connect Agent Updater" services are removed.
Remove ADSync service account
Login to the M365 or Entra AD admin console and remove the AD Sync service account from Azure/Entra AD active users.
Understanding the ADSync Service Account: The ADSync service account, created during AD Connect installation, plays a crucial role in the synchronization process. It handles authentication, authorization, directory synchronization, password synchronization, service health monitoring, and service updates. When uninstalling AD Connect, it's essential to remove this account from Azure/Entra AD active users.
Uninstalling AD Connect requires a meticulous approach to ensure a clean removal without leaving any remnants. Combining PowerShell commands with GUI actions provides a comprehensive solution. By following these steps, organizations can successfully uninstall AD Connect and maintain a secure and well-managed environment.