Exchange 2010 ships with some powerful scripts for Public Folder Replica administration and management.
These scripts only apply to servers running Exchange 2007 or Exchange 2010, you can not specify a server running older versions of Exchange Server, although the Public Folder hierarchy can still be on an Exchange 2003, in case you want to add additional replicas etc (see my previous post).
The scripts are located together with the Exchange binaries, under: C:Program FilesMicrosoftExchange ServerScripts.
The scripts recursively goes through and updates your public folders replicas for every public folder in a hierarchy that you specify.
These replica scripts are used to manage which servers hold replicas for the public folders.
This script can add a server to the replica list for a public folder and its subfolders.
In the example below EXCH-MBX-02 is added as a replica for all public folders on server EXCH-MBX-01 starting at the root folder of “”:
AddReplicaToPFRecursive.ps1 –Server EXCH-MBX-01 –TopPublicFolder “” -ServerToAdd EXCH-MBX-02
This script can remove a server from the list of replicas for a folder and its subfolders.
In the example below EXCH-MBX-02 is added as an replica for all public folders on EXCH-MBX-01 starting at the root folder:
RemoveReplicaFromPFRecursive.ps1 –Server EXCH-MBX-01 –TopPublicFolder –ServerToRemove EXCH-MBX-02
This script can replace a server in the replica list of the public folders with another server. This is useful when public folders are already replicated to more than one server, and one of those servers is being replaced.
In the example below EXCH-MBX-02 is being replaced with EXCH-MBX-03 as a replica for the “IT Department” folder and all subfolders:
ReplaceReplicaOnPFRecursive.ps1 –TopPublicFolder “IT Department” –ServerToAdd EXCH-MBX-03 –ServerToRemove EXCH-MBX-02
This script can replace all of the replicas on one server with the new server specified, no need of specifying a particular parent folder with this script, it will check the entire public folder tree when making the replacements.
This is useful when you want to move all of the replicas from one server to another at once, whereas the ReplaceReplicaOnPFRecursive.ps1 script allows it to be done in a staged manner.
In the example below, all replicas from EXCH-MBX-01 is moved to EXCH-MBX-02:
MoveAllReplicas.ps1 –Server EXCH-MBX-01 –NewServer EXCH-MBX-02