Manually Remove Exchange

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.

setup.exe /mode:uninstall

Manually Remove Exchange Gracefully

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.

Manually Remove Exchange with ADSIEDIT

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

Manually Remove Exchange Server with ADSIEDIT

Repeat the above procedure but this time remove any databases that were hosted on the failed server.

Manually Remove Exchange Server Databases

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

Manually Remove Exchange Organisation from AD

Delete: CN=Configuration,DC=YourDomain,DC=com > CN=Services > CN=Microsoft Exchange AutoDiscover

 Manually Remove Exchange Autodiscover from AD

Now connect ADSIEdit to the Default Naming Context.

Manually Remove Exchange Groups from AD

Navigate to DC=YOUR-DOMAIN and locate

OU=Microsoft Exchange Security Groups
CN=Microsoft Exchange System Objects

Then delete them BOTH

Manually Remove Exchange Secuty Groups from AD

 

Manually Remove Exchange Secuty Groups from AD

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}

Manually Remove Exchange User Objects from AD

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

Manually Remove Exchange Computer Object

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).

Manually Remove Exchange DNS

Manually Remove Exchange DNS

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.

Manually Remove Exchange DNS Zones

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.

Manually Remove Exchange From Registry

HKEY_LOCAL_MACHINE > System > CurrentControlSet > Services > MSExchange* (there will be a LOT!)

Manually Remove Exchange From Registry

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

Author: PeteLong

Share This Post On

Submit a Comment

Your email address will not be published. Required fields are marked *