Microsoft Exchange Server is heavily dependent on the Active Directory Schema. Most of the configuration of the Exchange Server is saved in the Active Directory Schema. There are several other places where the Exchange Server stores information which is needed to run, for example, DNS, databases, logs, and other files. But the most important is the schema in the domain controller/s.
So, Why Would Anyone Need to Clear or Clean-up the Active Directory Schema?
There are several reasons why you would need to clean-up your Active Directory Schema. Some of them are:
- You have a failed or dead Exchange Server and you would like to start from scratch as the old configuration is stopping you from re-installing differently or halting the installation due to the old configuration.
- After migrating to a newer version of Exchange Server, you did not uninstall the old Exchange Server correctly or something went wrong and there are leftovers of configuration which need to be cleaned up.
- After migrating to a new Exchange Server or Office 365, you need to make sure that any reference to the old Exchange Server or the failed server in your schema is removed completely.
What Is the Right Way to Clean-up the Active Directory Schema?
The right way to clean-up the Active Directory Schema is to uninstall the Exchange Server in a smooth way to ensure that all the related entries in the schema are cleaned and removed correctly. In most of the cases, this would work. However, during the uninstall, there could be issues with the Exchange Server or Active Directory that would not remove a configuration entry or not being able to do it due to rights or the uninstallation is interrupted due to failed server.
How to Remove Failed Exchange Server from Active Directory?
To completely remove Exchange Server configuration and other references from the Active Directory, you will need to remove several entries from the schema so these do not conflict with Outlook, Auto Discover service, or new installation of Exchange Servers. To remove these entries, you need to use ADSIEdit.msc command to connect to the Active Directory Schema to change, delete, or add entries.
Caution: When using the ADSIEdit, you will be editing the actual Active Directory Schema and any mistakes can have grave repercussions on the health of your Domain Controller services. Be careful and document any changes for future reference and always take an Ad-Hoc backup of your Domain Controller before making any changes to your schema. One of the reasons why this is recommended is that there is no undo button when editing your Active Directory Schema.
Below are the instructions on how to completely remove a failed Exchange Server from the Schema:
- From the Domain Controller, right-click on the Start button and click on Run.
- Alternatively, you can press the Windows + R keys to open the Run window.
- In the Open dialog box, enter asdiedit.msc and click OK.
- Right-click on ADSIEDIT and click on Connect to…
- Change the Select a well-known Naming Context from Default Naming Context to Configuration.
- Click OK. This will open the configuration of your server.
- Expand Configuration.
- Expand the CN=Configuration.
- Expand CN=Services.
- You will see a lot of sections in the Services which you will need to expand. CN=Microsoft Exchange and CN=Org (which in your setup would be the name of the organization) will reveal all the configuration of your Exchange installation.
- To remove a single server from the schema, expand CN=Administrative Groups, expand CN=Exchange Administrative Group, and then expand CN=Servers.
- Here you will find all the servers which are configured in the Schema.
- To delete the server from the configuration, right-click on CN=EXCHANGE and click on Delete. In this case, the server computer name is EXCHANGE.
This will remove the single server from your configuration. Now, there are other things which might be pointing to that server, like databases, which you need to remove from the configuration also.
Databases can be found under CN=Databases. The databases which have their entry with CN= would need to be removed.
To remove the server from the Active Directory groups, follow these steps:
- Open the Active Directory Users and Computers from the Administrative Tools.
- Expand the Domain name and click on the Microsoft Exchange Security Groups organizational unit (OU).
- Double-click on the Exchange Server Security Group.
- Click on Members.
- Click on the server’s name you need remove and click Remove.
Now, the last step is to remove the computer account. For this,
- Click on the Search button.
- Change the Find to Computers.
- Enter the server name under the Computer name dialog box and click Find.
- Right-click on the server and click on Delete.
As you can see, the above process to remove a failed Exchange Server from the Active Directory Schema is lengthy and time-consuming. There are several things that may go wrong. If any mistakes are made, it may render the other server in your setup unusable. In such a case, a tool that could come in handy is Stellar Repair for Exchange. This tool is specialized for Exchange server recovery that allows you to open any version of Exchange Server database, browse through it, and export the data to PST and other formats. It also allows you export directly to live Exchange databases and Office 365.