How to Uninstall a Stubborn Exchange Server

Sometimes uninstalling a Microsoft Exchange server with the Control Panel's Add/Remove Programs applet isn't possible. The reasons vary, with one of them being that the Exchange server isn't able to communicate properly with the DCs. If you understand what occurs during an Exchange installation, you can manually undo the changes made by the Exchange setup process to remove an unwanted Exchange server.

Here are the changes that occur when you install Exchange server:

  1. The Active Directory (AD) schema is extended. New class and attribute definitions are created.
  2. The configuration information in AD is modified. Under the Configuration partition in the Services section, a new container named Microsoft Exchange is created. This container represents the Exchange organizational hierarchy.
  3. New user groups are created in AD. For example, in Exchange Server 2003 and Exchange 2000 Server, two user groups—Exchange Domain Servers and Exchange Enterprise Servers—are created in the domain's Users container. The Exchange servers in a domain are members of the Exchange Domain Servers group. The Exchange Domain Servers group is a member of the Exchange Enterprise Servers group. In Exchange Server 2010 and Exchange Server 2007, several new groups are created under a new organizational unit named Microsoft Exchange Security Groups, which resides in the root domain of the forest.
  4. The server's registry is changed. The changes occur in two registry keys: HKLM\Software and HKLM\System\CurrentControlSet\Services.
  5. A folder hierarchy for the Exchange installation files is created under a folder specified during the installation.

 If you want to manually uninstall an Exchange server, you must manually undo some of these changes:

  1. You don't need to worry about the AD schema changes that the Exchange installation made. These changes can't be reversed because you can't delete schema objects and attributes. Even if you could, it wouldn't be a good idea. If you have multiple Exchange servers, the remaining servers need these schema objects and attributes. Plus, if you uninstall your lone Exchange server, the schema objects and attributes that remain won't cause any problems. In fact, if you should later decide to install Exchange again, it would take a shorter time because the schema have been already changed.
  2. The server's configuration information in AD can be removed using the ADSI Edit console (ADSIEdit.msc). In Windows Server 2003 and Windows 2000 Server, this tool is one of the Support Tools, which aren't install by default. In Windows 2008, the ADSI Edit console is installed by default. To remove the configuration information, open the ADSI Edit console, and navigate to Services\Microsoft Exchange\ExchangeOrganizationName\AdministrativeGroups\RelatedOrganizationGroup\Serverswhere ExchangeOrganizationName is the name of your Exchange organization. After you locate the server you want to uninstall, simply delete it.
         Alternatively, you can delete the Microsoft Exchange container altogether. By doing this, you delete the Exchange organization's information in AD. However, be aware that removing a server this way isn't supported by Microsoft unless you're instructed to do so by its Customer Service and Support (CSS) staff. In addition, you run the risk of leaving semi-deleted objects or partially mail-enabled objects in AD. This isn't important if you don't plan to install Exchange into a forest again, but it is important if you do, as you can run into problems. To mitigate these risks, I delete the Microsoft Exchange container after moving the mail-enabled objects to other servers or after deleting them.
  3. You can delete the user groups related to the Exchange server, but this step isn't necessary. You should do this only if you want to undo all the changes.
  4. You need to delete the following registry keys on the Exchange server:
  • In Exchange 2010 and Exchange 2007, delete the HKLM\Software\Exchange and HKLM\Software\Exchange Server keys.
  • In Exchange 2003 and Exchange 2000, delete the HKLM\Software\Exchange key.
  • In the HKLM\System\CurrentControlSet\Services key, delete the keys that were created for the Exchange Server services. In Exchange 2010 and Exchange 2007, all the keys related to the Exchange Server services start with MSExchange (e.g., MSExchangeIS). In Exchange 2003 and Exchange 2000, most of the keys also start with MSExchange. However, three keys have names that don't include this string. They are IMAP4Svc, POP3Svc, and RESvc.

5.   You should delete the files under the root Exchange Server folder.

By following these steps, you can manually uninstall an Exchange server. I've done so successfully several times.

Discuss this Article 9

zloeber
on Sep 6, 2010
Murat, I agree with you. I've been through the process of upgrading 8 exchange 2010 servers to SP1 and half of the servers were left in an unusable state. /M:RecoverServer did nothing to help the situation and all the cryptic powershell errors when upgrading/uninstalling helped very little. I believe that MS has tunnel vision in their newer products and assume an absolute clean slate infrastructure. Well in the real world, I've yet to see a single infrastructure without issues or that conform to the MS mold of thought (which has changed through the years btw). Astrid, if you live in the land of labs and perfect scenarios then what you say is true. Oh, and contacting support comes with a cost. It is easy to make that recommendation if you are on the inside collecting that cost.
Haydar Yener ARICI
on Jul 14, 2010
Hello my teacher,
Thank you for sharing this important point.
mbroberson
on Apr 26, 2010
this is a great way of removing exchange but I would highly recommend you research Why you can not uninstall from the control panel first. Many times there is a good reason why it will not uninstall. a user account still on a database, or a Deleted mailbox that has not been purged. in some cases there are mailboxs that are not as obvious that may keep this from happening. and if they are "hard removed" will cause problems later. So research first. Then use this as an Absolute last resort.
muraty
on May 26, 2010
Dear Astrid,
I'm very disappointed with your warnings. The procedure outlined in the article is a working and proved procedure. As I stated in the article, I used this procedure several times without any problem.
Your recommendations are useless because this procedure should be used after regular attempts to uninstall the Exchange Server. If your articles would be a cure I could use them already.
You'd better focus on making Exchange Server a great product again. To criticise working procedure found by the soldiers in the field should not be your focus.
astridmcclean
on May 20, 2010
These instructions are unsupported for both Exchange 2007 and Exchange 2010. Although they may work or appear to work, youll put yourself in an unsupported state that would require you to rebuild the server from scratch before you can re-install Exchange. As such, Microsoft advises readers to not attempt the process outlined in this article.

The supported process to recover a lost or orphaned Exchange server and then decommission it is a two-part process that starts with running server recovery for Exchange 2007 (http://technet.microsoft.com/en-us/library/bb123496(EXCHG.80).aspx) or Exchange 2010 (http://technet.microsoft.com/en-us/library/dd876880.aspx). Then, you perform an orderly uninstall of Exchange 2007 (http://technet.microsoft.com/en-us/library/bb123893(EXCHG.80).aspx) or Exchange 2010 (http://technet.microsoft.com/en-us/library/ee332361.aspx). If these processes are not successful, we recommend that you contact Microsoft support for assistance (http://support.microsoft.com/ph/13965#tab6 )

Please or Register to post comments.

IT/Dev Connections Exchange Server

Las Vegas
September 30th - October 4th

Paul ThurottYou'll have the opportunity to experience:
• Future Deopyments
and Integrations
• Hybrid Deployments
• Exchange Online
• Windows 8 Deployment
and much more!

Come See Tony Redmond & Mark Minasi in Person!

Early Registration Now Open

Current Issue

May 2013 - The NameTranslate object is useful when you need to translate Active Directory object names between different formats, but it's awkward to use from PowerShell. Here's a PowerShell script that eliminates the awkwardness.

CURRENT ISSUE / ARCHIVE / SUBSCRIBE

Windows Forums

Get answers to questions, share tips, and engage with the Windows Community in our Forums.