Manually Remove Exchange KB ID 0001907
Problem
There are several reasons why you might want to manually remove Exchange from Active Directory, for example.
Failed or Offline Exchange Server: If the Exchange Server is not starting, (or is completely offline), it might be necessary to remove it manually to clean up the environment.
Incomplete Uninstallation: Sometimes, the uninstallation doesn’t complete properly, leaving behind remnants that can cause issues.
Migration to a Newer Version: After migrating to a newer version of Exchange, or migrating to Office 365, you may need to remove old configurations to avoid problems.
Corruption: If the Exchange Server is corrupted or cannot be recovered, manual removal might be the only option.
Removing Old References: To ensure that no legacy references to the previous Exchange Server remain, which could interfere with new installations.
Solution Manually Remove Exchange
Before you start, ensure there are no remaining Exchange servers in your organization that rely on the one you are removing. If migrating to another Exchange server, verify mailboxes, connectors, and databases have been transferred properly.
Also consider trying to recover the Exchange server, and then removing it gracefully, or performing a migration.
Safely Remove Exchange
If you do not have access to the Exchange Management shell, and the server still exists, you can either mount the installation media for Exchange and use the following commands. Note: You do not actually need the media, if you locate the ‘bin‘ folder on your Exchange server you will find setup.exe* in there, and can run the uninstall command from that location.
*Note: Older versions of Exchange may need to use setup.com not setup.exe.
[box]
setup.exe /mode:uninstall
[/box]
Manually Remove Exchange Server
On a Domain controller Open ADSI Edit (adsiedit.msc) > Right-click ADSI Edit > Connect to… In “Select a well-known Naming Context,” choose Configuration> Click OK.
Navigate to CN=Configuration,DC=YourDomain,DC=com > CN=Services > CN=Microsoft Exchange > CN=First Organization > CN=Administrative Groups > CN=Exchange Administrative Group (FYDIBOHF23SPDLT) > CN=Servers.
Note: This assumes you have not manually named your, Exchange organisation or administrative group something else.
Locate the offending Exchange server, and delete it
Repeat the above procedure but this time remove any databases that were hosted on the failed server.
Manually Remove Exchange Envrionment Completely
Now if you completely want to COMPLETELY remove Exchange* from your organisation, Delete the following,
Note: Dont do this if you still have live Exchange servers!
Delete: CN=Configuration,DC=YourDomain,DC=com > CN=Services > CN=Microsoft Exchange
Delete: CN=Configuration,DC=YourDomain,DC=com > CN=Services > CN=Microsoft Exchange AutoDiscover
Now connect ADSIEdit to the Default Naming Context.
Navigate to DC=YOUR-DOMAIN and locate
OU=Microsoft Exchange Security Groups
CN=Microsoft Exchange System Objects
Then delete them BOTH
On a domain controller, or a system that has the RSAT tools installed, launch Active Directory Users and Computers (dsa.msc). Navigate to your domain > Users. Then locate and delete the following objects.
- DiscoverySearch Mailbox {GUID}
- Exchange Online-ApplicationAccount
- FederatedEmail.GUID
- Migration.GUID
- SystemMailbox {GUID}
Now whilst still in AD users and Computers. locate the Computer Object that represents the failed Exchange server and delete it. (Obviously if you are retaining the server for other purposes do not do this).
Note: If searching AD you will need to add in computers to the default search
Then remove the DNS entry in your DNS forward lookups zone (Check your reverse lookup zones and see if there’s a PTR record in there also that might need deleting).
IN SOME CASES, if you have deployed split DNS you may have entire zones that handle DNS addressing for you broken Exchange deployment, below is an example of what that may look like, these will also need to be removed.
Note: You may discover an autodiscover.your-domain forward lookup zone that also may need to be deleted.
Manually Delete Exchange From Registry
If you still have access to the server that’s failed, you can remove references to Exchange from its registry in the following locations.
HKEY_LOCAL_MACHINE > Software > Microsoft > ExchangeServer.
HKEY_LOCAL_MACHINE > System > CurrentControlSet > Services > MSExchange* (there will be a LOT!)
If you have retained Exchange, and were simply removing a single failed Exchange Server, you other Exchange servers may have cached references to that failed Exchange server, you can restart the Microsoft Exchange Information Store (MSExchangeIS) – Warning: This will dismount and remount the information stores, and may cause a popup on your Outlook clients. Or you can simply wait until the cache is refreshed.
Related Articles, References, Credits, or External Links
NA