Scripts for Managing Public Folders in the Exchange Management Shell
Microsoft Exchange Server 2007 will reach end of support on April 11, 2017. To stay supported, you will need to upgrade. For more information, see Resources to help you upgrade your Office 2007 servers and clients.
Applies to: Exchange Server 2007, Exchange Server 2007 SP1, Exchange Server 2007 SP2, Exchange Server 2007 SP3
Running scripts in the Exchange Management Shell can make public folder administration faster and easier by automating complex or frequently performed tasks. You can use scripts that are installed with Microsoft Exchange Server 2007 and described in this topic (as well as other scripts), or you can write your own scripts.
The collection of Exchange Management Shell scripts that are described in this topic are installed, by default, at C:\Program Files\Microsoft\Exchange Server\Scripts.
To run these scripts, the account you use must be delegated the following:
- Exchange Server Administrator role and local Administrators group for the target server
For more information about permissions, delegating roles, and the rights that are required to administer Exchange Server, see Permission Considerations.
For more information about using and writing scripts in Exchange 2007, see Scripting with the Exchange Management Shell.
Server Management Scripts
The following table lists the server management scripts that are included with Exchange 2007.
Task | Script | Description |
---|---|---|
Add a server to the replication list. |
AddReplicaToPFRecursive.ps1 |
This script adds a new server to the replication list for a public folder and all the folders beneath it in the hierarchy. If the server is already listed in the replication list for a folder, nothing is changed for that folder. This script accepts the following parameters:
|
Remove a server from the replication list. |
RemoveReplicaFromPFRecursive.ps1 |
This script removes a server from the replication list for a public folder and all the folders beneath it in the hierarchy. If the server is not listed in the replication list for a folder, nothing is changed for that folder. If the server is the only server on the replication list, the list is not changed. This script accepts the following parameters:
|
Replace a server in the replication list. |
MoveAllReplicas.ps1 |
This script replaces a server with a new server in the replication list for all public folders, including system folders. This script accepts the following parameters:
|
Replace a server in the replication list with a new server. |
ReplaceReplicaOnPFRecursive.ps1 |
This script replaces a server with a new server in the replication list for a public folder and all the folders beneath it in the hierarchy. If the server that you want to remove is not listed in the replication list for a particular folder, nothing is changed for that folder. This script accepts the following parameters:
|
User Management Scripts
The following table lists the user management scripts included with Exchange 2007.
Task | Script | Description |
---|---|---|
Add a user to the client permissions list. |
AddUsersToPFRecursive.ps1 |
This script adds a user and that user's permissions to the client permissions list for a public folder and all the folders beneath it in the hierarchy. If the user is already listed in the client permissions list for a folder, the user's permissions are updated to the new set that is specified in the script.
|
Replace a user with a new user in the client permissions list. |
ReplaceUserWithUserOnPFRecursive.ps1 |
This script replaces a user with a new user in the client permissions list for a public folder and all the folders beneath it in the hierarchy. Existing permissions for the first user are retained. Public folders that do not contain permissions for the user are not modified.
|
Replace a user's permissions. |
ReplaceUserPermissionOnPFRecursive.ps1 |
This script replaces the permissions of a user in the client permissions list for a public folder with a new set of permissions. It also replaces the permissions for all the folders in the hierarchy beneath that folder. Public folders that do not contain permissions for the user are not modified.
|
Remove a user from the client permissions list. |
RemoveUserFromPFRecursive.ps1 |
This script removes a user from the client permissions list for a public folder and from all the folders beneath it in the hierarchy.
|
For More Information
To learn more about public folders, see Understanding Public Folders.
For more information about public folder permissions, see Configuring Public Folder Permissions.
For more information about managing public folders, see Managing Public Folders.
For more information about using scripts to manage public folders in Exchange 2007, see Scripting with the Exchange Management Shell.
For more information about using the Exchange Management Shell, see Using the Exchange Management Shell.