It sounds like there may be some remnants of the AAD Connect service left on the computer, which is causing issues when trying to uninstall and reinstall. Here are some steps you can take to try and resolve this issue:
- Open an elevated command prompt by right-clicking on Command Prompt and selecting "Run as administrator".
- Type the following command:
sc delete ADSync
and press Enter. This should remove any remaining service entries related to AAD Connect. - Navigate to the Control Panel > Programs and Features, and try to uninstall AAD Connect again.
If the uninstall still fails, you can try the following steps:
- Download the latest version of AAD Connect from the Microsoft website.
- Open an elevated command prompt and navigate to the directory where the AAD Connect installer is located.
- Run the following command:
msiexec /x "MSI Filename" /L*v "Log Filename"
. Replace "MSI Filename" with the name of the AAD Connect installer file and "Log Filename" with a desired name for the installation log file. - This should start the uninstallation process and create a log file for any errors encountered during the process.
- Once the uninstallation is complete, try reinstalling AAD Connect using the latest installer you downloaded.