How to remove Exchange 2007 from a computer

Article translations Article translations
Article ID: 927464 - View products that this article applies to.
Expand all | Collapse all

On This Page

INTRODUCTION

This article describes how to completely remove Microsoft Exchange Server 2007 from a computer in an existing Microsoft Exchange Server organization and from Active Directory.

MORE INFORMATION

Exchange 2007 is removed differently from earlier versions of Exchange Server. You cannot manually remove Exchange 2007 from a computer. The only supported ways to remove Exchange 2007 are to use Add or Remove Programs or to use the Setup program on the Exchange 2007 CD to remove Exchange 2007 and to remove the Exchange 2007 object from Active Directory.

To remove Exchange 2007 from a computer, use the following guidelines.

Remove the Exchange 2007 Mailbox server role

Before you remove an Exchange 2007 computer from the organization, you must remove the public folder stores that are located on that computer.

Caution If you remove the last public folder database, all the contents of the last public folder database contents will be lost. Additionally, only users who are running Microsoft Office Outlook 2007 or a later version of Microsoft Outlook will be able to connect to the Exchange organization. Do not remove the last public folder database if your organization uses organizational forms. An organizational form is a system folder on an Exchange computer that stores forms that are typically accessed by users in an organization.

A public folder store cannot contain any replicas when you try to remove it. This includes replicas of system folders. If a public folder store contains any public folder replicas, you must first move these replicas before you remove the public folder store. If you try to remove a public folder store before you move the replicas that it contains, you will receive the following error message:
The public folder database Database_Name cannot be deleted.
Error:
The public folder database specified contains folder replicas. Before deleting the public folder database, remove the folders or move the replicas to another public folder database.

Verify the contents of the public folder store

The public folder store contains the Interpersonal Message (IPM) Subtree that Outlook clients can see and the non-IPM Subtree or system folder that clients cannot see. If you want to verify the contents of the IPM Subtree and the non-IPM Subtree, you can redirect and view this information as text files. To do this, follow these steps:
  1. Click Start, point to All Programs, point to Exchange Server 2007, and then click Exchange Management Shell.
  2. At the MSH prompt, change to the following folder:
    Drive_Letter:\Program Files\Microsoft\Exchange Server\Scripts
  3. Run the following commands:
    • Get-PublicFolderStatistics -server <Exchange 2007_Server_Name> | fl | out-file C:\PFstat.txt
    • Get-PublicFolder -server < Exchange 2007_Server_Name > \ -recurse | fl | out-file C:\PFIPMSub.txt
    • Get-PublicFolder -server < Exchange 2007_Server_Name > \non_ipm_subtree -recurse | fl | out-file C:\PFNonIPMSub.txt

      The Get-PublicFolderStatistics command will show you the data that is contained in the public folder store. The Get-PublicFolder commands together with the respective switches will show you the replicas that are set for the IPM Subtree and the non-IPM Subtree.

Remove the replicas from the public folder store

You must use one of the following methods to remove the replicas from a public folder store. After you use one of these methods, you must wait between 15 minutes and two hours for the moves to be completed physically.
Method 1: Use the MoveAllReplicas.ps1 script
You can use the MoveAllReplicas.ps1 script to change the server in the replica list for all public folders to another server. Move to the command prompt at the Exchange Command Shell, and then use the script. To do this, follow these steps:
  1. Click Start, point to All Programs, point to Exchange Server 2007, and then click Exchange Management Shell.
  2. At the MSH prompt, change to the following folder:
    Drive_Letter:\Program Files\Microsoft\Exchange Server\Scripts
  3. Run the following command:
    MoveAllReplicas.ps1 -Server Source_Server_Name –NewServer Target_Server_Name
    Note The source server must be an Exchange 2007 mailbox server that contains a public folder store. The target server must be an Exchange server that contains a public folder store.
Method 2: Use Exchange System Manager in Exchange 2003
If you are running Microsoft Exchange Server 2003 in the organization, you can move the replicas from the Exchange System Manager in Exchange 2003. To do this, follow these steps:
  1. Start Exchange System Manager.
  2. Expand Administrative Groups, expand First Administrative Group, expand Servers, and then expand the Exchange Server 2007 object.
  3. Expand First Storage Group, right-click the appropriate public folder store, and then click Move All Replicas.
  4. In the Move All Replicas dialog box, click the Exchange server to which you want to move the replicas, and then click OK.
After you use one of these methods, you must wait for the next instance of public folder replication to complete before the public folder replicas are removed. You can verify the status by using the Get-PublicFolderStatistics command that is mentioned in the "Verify the contents of the public folder store" section.

Remove the public folder store

After you confirm that all replicas have been removed, you must remove the public folder store on the Exchange 2007 computer. You can do this from the Exchange Management Console or from the Exchange Management Shell prompt.
Method 1: Use the Exchange Command Shell
After the replicas have been moved, you can remove the public folder store from the Exchange Command Shell prompt. To do this, run the following command at the Exchange Command Shell prompt:
Remove–PublicFolderDatabase –Identity "Public_Folder_Store_Name"

To remove the last public folder store in an organization, run the following command.

Important See the cautionary note at the beginning of the "Remove the Exchange Server 2007 Mailbox server role" section before you remove the last public folder store in an organization.
Get-PublicFolderDatabase | Remove-PublicFolderDatabase -RemoveLastAllowed
Method 2: Use the Exchange Management Console
To remove the public folder store from the Exchange Management Console, follow these steps:
  1. Start the Exchange Management Console.
  2. In the Console tree, expand Server Configuration, and then click Mailbox.
  3. In the results pane, click the appropriate server.
  4. In the work pane, expand the appropriate storage group, and then click the public folder database that you want to remove.
  5. In the action pane, click Remove, and then click Yes.
  6. In the Public folder database name box, type the name of the public folder database.
  7. Follow the instructions in the wizard.

Remove the Exchange 2007 administrative group

  • When you remove the last computer that is running Exchange 2007 in a mixed-mode Exchange Server organization, the administrative group for Exchange 2007 remains in Active Directory. This behavior is by design.
  • Only one administrative group is installed when you install Exchange 2007. This administrative group name cannot be changed. For more information, visit the following Microsoft Web site to view the related Exchange Team blog:
    http://msexchangeteam.com/archive/2006/08/08/428619.aspx
  • You can delete the administrative group for Exchange 2007 by using ADSIEdit. However, there is no reason to delete the administrative group. A new installation of Exchange Server 2007 runs the forestprep command again. The forestprep command adds the same administrative group name.

Move the Exchange 2007 Routing Group Connectors on the computer that has HUB transport role

  • Move the Routing Group Connectors by using the following command:
    Get-RoutingGroupConnector | where {$_.SourceTransportServers -like "<First Exchange 2007 server>"} | Set-RoutingGroupConnector -SourceTransportServers "<Second Exchange 2007 server>"
    Get-RoutingGroupConnector | where {$_.TargetTransportServers -like "<First Exchange 2007 server>"} | Set-RoutingGroupConnector -TargetTransportServers <Second Exchange 2007 server>
  • To modify any Send connectors that have the first Exchange 2007 server as the source transport server, run the following commands:
    Get-SendConnector | where {$_.SourceTransportServers -like "<First Exchange 2007 server>"} | Set-SendConnector -SourceTransportServers "<Second Exchange 2007 server>"
  • To modify any Foreign connectors that have the first Exchange 2007 server as the source transport server, run the following commands:
    Get-ForeignConnector | where {$_.SourceTransportServers -like "<First Exchange 2007 server>"} | Set-ForeignConnector -SourceTransportServers "<Second Exchange 2007 server>"
  • To verify that the connectors have been moved, test mail flow by using the Test-Mailflow cmdlet.

Remove Exchange 2007

  • The manual removal of Exchange 2007 is not supported.
  • In beta versions of Exchange 2007, use Add or Remove Programs to remove Exchange 2007. This will remove Exchange 2007 and will remove the Exchange Server object from Active Directory.
  • When the original release version of Exchange 2007 is released, you can use Add or Remove Programs to remove Exchange 2007. Alternatively, you can insert the Exchange 2007 CD to automatically start the removal option.
  • You do not have to remove any registry entries when you remove Exchange 2007.
  • Some files such as database files and setup log files remain after you remove Exchange 2007. You can manually remove these files if you want. This includes the EXCHSRV subdirectory. If you want to save the databases before you remove Exchange 2007, you can dismount the databases. Then, save a copy to another location.

    Note You can completely reinstall the operating system, and then reinstall Exchange 2007. However, this is not required.

Remove the Default Web Site

  • By design, when you remove Exchange 2007, the following virtual servers that are created for Exchange 2007 under the Default Web Site are not removed:
    • Microsoft-Server-ActiveSync
    • OAB
    • owa
  • You do not have to remove Microsoft Internet Information Services (IIS) to completely remove Exchange 2007. By default, the Exchange 2007 virtual servers under the Default Web Site in IIS remain on the server. You do not have to remove the Exchange 2007 virtual servers in IIS. However, you can manually delete the virtual servers if you want.

    Note IIS is removed when you manually remove Microsoft Exchange Server 2003 from a computer. This removes the virtual directories in Exchange 2003.
  • You can remove IIS from the server, reinstall IIS, and then reinstall Microsoft Windows service packs and hotfixes. However, this is not required.

Properties

Article ID: 927464 - Last Review: December 5, 2008 - Revision: 5.0
APPLIES TO
  • Microsoft Exchange Server 2007 Standard Edition
  • Microsoft Exchange Server 2007 Enterprise Edition
Keywords: 
kbexchsetup kbinfo kbhowto KB927464

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com