Sometimes, the configuration of Azure AD Connect goes wrong and stops. Azure AD Connect can end up in a state where you can no longer recover. Alas, in these cases uninstallation may also not be an option… or so it seems.
The situation
Azure AD Connect is installed on a Windows Server installation, but not configured or unable to resume configuration.
Admins now want to remove Azure AD Connect.
From the Start Menu the Add or remove programs item is searched and selected, or from the Start right-click menu (Start + X) the Apps and features menu option is chosen.
In the Apps & features window of Settings, the Microsoft Azure AD Connect item is selected. The button Uninstall is pressed.
In the This app and its related info will be uninstalled. pop-up, the button Uninstall is also pressed.
The issue
The following error appears:
Windows states it cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.
The cause
The uninstallation option for Azure AD Connect in the Add & Features screen is broken.
The solution
You can uninstall Azure AD Connect using the right uninstaller.
The information we need can be gathered by issuing the following command line:
wmic.exe product
For the Microsoft Azure AD Connect product, you’ll see a *.msi file listed in the LocalPackage column. This file is located in the C:\Windows\Installer\ folder.
Perform the following steps:
- Double-click the *.msi file.
- Click Next on the Welcome to the Microsoft Azure AD Connect Setup Wizard page of the Microsoft Azure AD Connect Setup wizard.
- Click Remove on the Change, repair or remove page of the wizard.
- Click Remove on the Ready to remove Microsoft Azure AD Connect page of the wizard.
The Microsoft Azure Active Directory Connect appears. - Click Remove. to also uninstall the Azure AD Sync Engine, Microsoft SQL Server 2012 Command Line Utilities, Microsoft SQL Server 2012 Native Client and Microsoft SQL Server 2012 Express LocalDB.
- Click Exit when uninstallation is completed.
Concluding
After Azure AD Connect is correctly removed from the Windows Server, you can start installation and configuration of Azure AD Connect from scratch, or decide to install Azure AD Connect on another Windows Server installation.
If your goal is to get rid of Azure AD Connect, then you’ve completed your goal.
Helpful! Thank you so much.
So many things that go wrong, thank goodness we have the internet to help us find handy nuggets of helpfulness like this.
Hi Sander, do you know what is AADConnect_Uninstall-*.log file mean? And why it starts running? What processes trigger creation of this LOG file?
I don't know.
I have not seen this behavior on an Entra Connect installation before.
As tested with Entra Connect v2.4.27.0 I noticed that the installer, AzureADConnect.msi, is the same as the one located in C:\Windows\Installer\ so I guess when you have saved the installation MSI you can use this installer (same version I guess) to uninstall. I did not test this myself but when I run the installer again I can choose 'remove'.
Also a fun fact(?) Entra Connect v2.4.27.0 still requires the unsupported 'Microsoft Visual C++ 2013 Redistributable (x64) – 12.0.21005' runtime.
When you uninstall this VC++ runtime the core synchronisation service 'ADSync' / 'Microsoft Azure AD Sync' located in "C:\Program Files\Microsoft Azure AD Sync\Bin\miiserver.exe" doesn't start!
This even when the supported VC++ 2015+ runtimes are installed.
That makes me wonder if Entra Connect is allowed in high regulated environments where no unsupported software is allowed.