Uninstalling Microsoft Exchange Server 2007 isn't as simple as running Setup and choosing the uninstall option. Moving specific server roles to different hardware can also be difficult because there are several required removal tasks that aren't outlined or available through the Exchange 2007 Setup wizard. The Mailbox and Hub Transport server roles are particularly challenging because there are complicated steps involved in uninstalling them.
This tutorial takes the guesswork out of removing Exchange Server 2007 or individual server roles from a computer. It provides detailed instructions on how to uninstall Exchange 2007 and its associated server roles, including the Client Access server role, Edge Transport server role, Hub Transport server role and Mailbox server role.

HOW TO UNINSTALL EXCHANGE 2007 AND SERVER ROLES

Part 1: How to begin an Exchange 2007 uninstall
Part 2: How to uninstall the Exchange 2007 Client Access server role
Part 3: How to uninstall the Exchange 2007 Edge Transport server role
Part 4: How to uninstall the Exchange 2007 Hub Transport server role
Part 5: How to uninstall the Exchange 2007 Mailbox server role
Whether you wish to perform a complete uninstall of Exchange Server 2007 or only specific server roles, the beginning portion of the uninstall process is fairly straightforward:
- On the server, go to Control Panel -> Add/Remove Programs.
- Select Microsoft Exchange Server 2007 from the list of installed programs.
- Click Remove to launch the Exchange Server 2007 Setup wizard.
- Click Next to bypass the Welcome screen and view a screen similar to that in Figure A, asking you which roles you want to remove.

Figure A. Use the checkboxes to remove server roles.
You can use the above process whether you want to remove an individual role from the server, or uninstall Exchange Server 2007 completely. When you click Next, the Setup wizard will perform a readiness check -- and that's where the trouble begins.
Exchange Server 2007 Setup wizard doesn't know how to deal with an uninstallation or role removal. This means that there are several tedious tasks that you will have to manage prior to removing various roles. The Exchange Server 2007 Setup wizard instructs you as to which tasks you must perform, as shown in Figure B.

Figure B. The Setup wizard outlines several tasks you must
perform prior to uninstalling Exchange Server 2007.
Unfortunately, the wizard doesn't give specific instructions on to how to perform these tasks, some of which include using the Recommended Action link to get more information. In addition, the Web sites that Recommended Actions are linked to are vague. In the remaining sections of this tutorial, I explain how to perform these tasks and provide step-by step instructions for properly uninstalling the Client Access, Edge Transport, Mailbox and Hub Transport server roles.
Removing the Client Access server role is fairly simple:
- On the Exchange Server, go to Control Panel -> Add/Remove Programs.
- Select Exchange Server 2007 from the list of installed applications, and click Remove to launch the Exchange 2007 Setup wizard.
- Click Next to bypass the welcome screen and move to a screen displaying various Exchange 2007 server roles that have been installed.
- Deselect the checkbox corresponding to the Client Access role, and click Next.
The Exchange Server 2007 Setup wizard will now check to make sure that it can remove the Client Access server role. Because there are no prerequisites that must be met, the Setup wizard will confirm that everything is ready and then begin removing the associated files.
For this particular server role, note that the Setup wizard will not prompt you to continue once prerequisite checks are completed. It will remove the Client Access Server (CAS) role -- whether you're ready or not.
The amount of time that it takes to remove the CAS role varies from server to server. On my test system, however, the entire process took just over five minutes from start to finish.
Exchange Server 2007 Edge Transport servers are unique in that they're not connected directly to Active Directory or the rest of the Exchange organization. Instead, they use an Edge Subscription to replicate a minimal amount of information from Active Directory to a special Active Directory Application Mode (ADAM) partition stored on the server.
From a removal standpoint, this means that there is virtually no affect on your Exchange organization if you decommission an Edge Transport server. The only task you need to do prior to removing an Edge Transport server is eliminate the Edge Subscription.
There are two methods to remove an Edge Subscription. While these methods weren't verified in a lab environment, they both should work:
- Method 1
Open the Exchange Management Console from within your primary Exchange organization (not on the Edge Transport server, and navigate through the console tree to Organization Configuration -> Hub Transport. Select the Hub Transport container, and then select the Edge Subscriptions tab from the details pane. Now right click on the Edge Subscription you want to remove, and select Delete from the menu. - Method 2
Open the Exchange Management Shell and enter the Remove-EdgeSubscription command. For the exact syntax of this command, read the Remove-EdgeSubscription description on the Microsoft Exchange Server TechCenter.
When removing roles from Exchange Server 2007, two tend to be the most difficult: the Mailbox server role and the Hub Transport server role. The steps involved in removing the Hub Transport server role vary depending on whether there are other Exchange servers in your organization. The version of Exchange Server used on your servers also makes a difference. It is more work to uninstall the Hub Transport server role if there are Exchange 2003 servers in the organization than if Exchange 2007 was the only version in use.
Let's assume that you have some Exchange 2003 servers in your organization. If all Exchange servers are running Exchange 2007, or if your organization only consists of one server, then you may be able to skip some of these steps:
- On the Exchange server, go to Control Panel -> Add/Remove Programs to view a list of all installed applications.
- Select Exchange Server 2007 from the list of programs and click Remove.
- When Windows launches the Exchange Server 2007 Setup wizard, click Next to bypass the Welcome screen..
- You will now see a screen that displays the various Exchange 2007 server roles that have been installed. Deselect the checkbox corresponding to the Hub Transport role and click Next.
- The Setup wizard will perform a prerequisite check, because there are some steps that must be taken before the role can be removed. Specifically, the server hosting the Hub Transport role is configured, by default, to act as a bridgehead server for the various routing group connectors. These routing group connectors must be removed before the Hub Transport server role can be uninstalled.
If you have Exchange 2003 servers installed, then Exchange 2007 doesn't natively use routing groups, but will create them for backward-compatibility purposes. To eliminate necessary routing group connectors:
- Go to your Exchange 2003 server and open the Exchange System Manager.
- Navigate through the console tree to Administrative Groups -> your administrative group -> Routing groups -> your routing group -> Connectors.
- Select the Connectors container and the details pane will show you connectors for the routing group.
The actual connectors that exist will differ from one deployment to another. Typically, there will be an Internet Mail SMTP connector and a routing group connector.
- Right click on the routing group connector, and select Properties from the menu.
- Go to the Remote Bridgehead tab, and check that the remote bridgehead server listed is one from which you want to remove the Hub Transport server role.
- If so, you can do one of two things:
- Point the connector to a different remote bridgehead server.
- Remove the connector completely.
- To remove the routing group connector, click OK to close the connector's properties sheet.
- Right click on the connector and select Delete from the menu.
- When Exchange asks if you really want to delete the connector, click Yes.
Exchange Server 2007 resources:
There likely will be at least one more connector to delete. Although Exchange 2007 doesn't natively use administrative groups, it does create an administrative group for backward-compatibility purposes. This group contains its own routing group, which contains a connector. The name of this administrative group differs in each Exchange organization. By default, it is called the Exchange Administrative Group.
A long hexadecimal number in parenthesis should follow the words Exchange Administrative Group. It will also follow the default routing group within this administrative group. It is called the Exchange Routing Group, and will be followed by a long hexadecimal number in parenthesis.
To remove the associated routing group connector:
- Navigate through the console tree to Administrative Groups -> Exchange Administrative Group (long hexadecimal number) -> Routing groups -> Exchange Routing Group (long hexadecimal number) -> Connectors.
- Select the Connectors container, and the details pane will display a routing group connector.
- Right click on the routing group connector, and choose Properties from the menu.
- You will see a message informing you that you need a newer version of Exchange System Manager to edit the object. Click OK to ignore the message and go to the routing group's properties sheet.
- Look at the Remote Bridgehead tab. Because this routing group connector exists on an Exchange 2007 server, the remote bridgehead should point to a server in your 2003 routing group.
- Verify this and click OK to close the properties sheet.
- Right click on the routing group connector and choose Delete from the menu.
- Click Yes, when prompted, to remove the connector.
- Wait for the servers to synchronize with one another. Then go back to your Exchange 2007 server and try to remove the Hub Transport role. The server should now pass the prerequisite test.
- Once the readiness check is complete, click Uninstall to remove the Hub Transport role.
To uninstall the Mailbox server role, you must remove all mailboxes and public folders stored on the server.
To remove all mailboxes from the server:
- Open the Exchange Management Console and navigate through the console tree to Recipient Configuration -> Mailbox to view all the mailboxes in your organization.
- Identify the mailboxes stored on that server. If you only have one Exchange 2007 server in your organization, this won't bet an issue.
Mailboxes residing on an Exchange 2007 server are marked as User mailboxes, or other types of mailboxes. Any mailbox residing on Exchange 2000 or 2003 servers are listed as Legacy mailboxes (Figure C).

Figure C. Legacy mailboxes reside on Exchange 2000 or 2003 servers.
I have only a few Exchange mailboxes, which isn't typical for most companies. If you can't tell which mailboxes are hosted on an Exchange 2007 server by looking at the console, then you can implement a display filter:
- Click the Create Filter link at the top of the console. You will see a series of dropdown lists.
- Choose Server from the first dropdown list, and make sure that the second dropdown list is set to Equals.
- Click Browse and select the server from which you want to remove the Mailbox server role.
- Click Apply Filter, and the list of mailboxes will be filtered so that only those residing on the specified server are shown (Figure D). This figure also gives an example of how I set up the display filter.

Figure D. A display filter can help you determine which mailboxes reside on the server.
- Now that you know which mailboxes reside on the server, you have to move them. Right click on the mailboxes you want to move -- you can select multiple mailboxes -- and choose Move Mailbox from the menu to launch the Move Mailbox wizard.
- Select the server and information store where you want the mailboxes moved (Figure E).

Figure E. Select a destination for the mailboxes you are moving.
- Click Next, and you will be asked how you want to deal with corrupt mailboxes and when the move should occur.
- Answer these prompts and click Move to move the mailbox.
- When this is complete, you will see a summary screen informing you that all mailboxes were moved successfully. Confirm that there are no mailboxes on the target server. To do this, go back to the Exchange Server 2007 Setup wizard, and click Retry. If you have moved all of the mailboxes off the server, then the warning message should disappear.
Removing the public folder tree
There is one more step involved in uninstalling the Mailbox server role from Exchange 2007. Now that you've removed all mailboxes, you must remove all public folders as well.
Microsoft initially shipped Exchange Server 2007 before it was complete. As such, there no mechanisms in the graphical user interface (GUI) to remove public folders. Service Pack 1, which will be released within the next few months, should correct this problem. Until then, you need to use the Exchange Management Shell to remove public folders.
Note: This procedure assumes that you have replicas of your folders on other servers. This is important because we aren't migrating public folder data to another server. Instead, we are deleting public folders from our target server.
- Open the Exchange Management Shell and enter the following commands (where yourserver is the name of the target server):
Get-PublicFolder –ID '\' –Server yourserver -Recurse –ResultSize Unlimited -> Remove-PublicFolder –Recurse
Get-PublicFolder –ID \'Non_Ipm_Subtree' –Server yourserver -Recurse –ResultSize Unlimited -> Remove-PublicFolder –Recurse
The first command removes all of the public folders, except for those that the system created. The '\' in the command indicates that the removal action should begin at the root-level of the public folder tree. The second command removes public folders created by Exchange Server. This can include things like the offline address book (OAB) or the folder used to store free/busy information. Both commands use an unlimited result size, which is important for organizations with large public folder trees.
- After executing both commands, enter the following command to display any public folders that weren't removed:
Get-PublicFolder –ID '\'
The instructions I just outlined should easily strip a public folder tree bare. There is a caveat though. I have found that those commands won't remove corrupted folders. So you may need to go back and manually reconfirm that all folders were removed.