How to remove Exchange from Active Directory

Today’s article will show how to remove Exchange from Active Directory. We are going to force remove Exchange Server with ADSIEdit. Why with ADSIEdit and not from the default Exchange uninstallation wizard? Sometimes the Exchange uninstallation is not finishing or the Exchange Server can’t start anymore. This is one of the reasons when we remove Exchange Server from Active Directory with ADSIEdit. Let’s get started and look at how to remove Exchange from Active Directory.

Information

Some of these problems that can occur why we would use ADSI Edit:

  • Exchange Server is offline and does not start anymore
  • Removing previous Exchange Servers that did not uninstall properly
  • The uninstallation of the Exchange Server is not finishing and is in a corrupt state
  • Exchange Server is not uninstalled but turned off and removed from Active Directory
It’s not recommended to use ADSI Edit for Exchange tasks. There are situations that ADSI Edit is your last option.

Remove Exchange Server with ADSI Edit

Log in to the domain controller and navigate to the Start menu. Open Administrative Tools and start ADSIEdit.

Remove Exchange Active Directory

Remove Exchange Server attributes

Once opened, right-click ADSI Edit and click Connect to…

Select Configuration and click OK.

Remove Exchange Server from Active Directory ADSI Edit configuration

Expand CN=Configuration, DC=exoip, DC=local and expand CN=Services. Right-click on CN=Microsoft Exchange and click delete. A warning will show if you are sure to delete this object, confirm with Yes. Do the same with CN=Microsoft Exchange Autodiscover, right-click and click delete.

Remove Exchange Server from Active Directory ADSI Edit remove Exchange

After removing both the objects in ADSI Edit. The screen will look like the following.

Remove Exchange Server from Active Directory ADSI Edit after removing

Fold the connection Configuration in ADSI Edit. We don’t need it anymore.

Remove Exchange Server security groups and system objects attributes

Start Active Directory Users and Computers (ADUC). Expand the domain and verify that the Organizational Unit (OU) Microsoft Exchange Security Groups and Microsoft Exchange System Objects are present. We can remove it from here or from ADSI Edit. We are going to use ADSI Edit.

Remove Exchange Server from Active Directory ADUC before

Right-click ADSI Edit and click Connect to…

Select Default naming context and click OK.

Remove Exchange Server from Active Directory ADSI Edit default naming context

Expand DC=exoip, DC=local. Right-click on OU=Microsoft Exchange Security Groups and click delete. A warning will show if you are sure to delete this object, confirm with Yes. Do the same with CN=Microsoft Exchange System Object, right-click and click delete.

Remove Exchange Server from Active Directory ADSI Edit remove Exchange groups and objects

We can confirm in ADUC that both the OUs are deleted.

We are going to remove Exchange Server from Active Directory in the next step.

Remove Exchange from Active Directory

Remove the Exchange Server if it’s showing in Active Directory Users and Computers (ADUC). Right-click the Exchange Server and click Delete.

Remove Exchange Server from Active Directory ADUC remove Exchange computer

A warning is showing if you are sure to delete the Exchange Server, click Yes.

Remove automatically generated Exchange user accounts

There are a few Active Directory users that are generated automatically by Exchange. Some serve as Discovery services, others are used to monitor the health of the Exchange system. These will no longer be needed if you have permanently removed Exchange from your organization.

Go to Active Directory Users and Computers and open the Users container. Right-click the following users and click delete.

  • DiscoverySearch Mailbox{GUID}
  • Exchange Online-ApplicationAccount
  • FederatedEmail.GUID
  • Migration.GUID
  • SystemMailbox{GUID}

Remove Exchange Server from Active Directory ADUC remove users

After removing it will show like the following.

Remove Exchange Server from DNS

Remove the Exchange Server from the DNS Forward Lookup Zones. Click the default zone and search in the list for the Exchange Server. Right-click the Exchange Server and click Delete.

Remove Exchange Server from Active Directory DNS remove record

Remove the forward lookup zones if you have any configured for Exchange Server. Right-click and click Delete.

Remove Exchange Server from Active Directory remove DNS forward lookup zones

After removing the zones, it will look like the following screen.

Remove the static IP from DHCP and any other places that you have the IP or DNS name configured. For example, the firewall and Public DNS.

Conclusion

In this article, you learned how to remove Exchange from Active Directory. Always uninstall Exchange Server with the uninstall wizard or in unattended mode. This will remove Exchange from the server and removes the server’s Exchange configuration from Active Directory. It’s important to know that removing Exchange Server with ADSI Edit is your last option to use.