Remove Multiple Public Folders from a Public Folder Database
Applies to: Exchange Server 2010
You can use the Shell to remove all the public folders from a public folder database.
This procedure removes all the user and system public folders from a public folder database. If you only want to remove one public folder from a public folder database, see Remove Public Folders. This procedure is required if you are removing the last public folder database in your Exchange organization. For detailed instructions about how to remove public folder databases, see Remove Public Folder Databases.
Warning
If you want to remove a public folder database on a specific server running Microsoft Exchange Server 2010, you must move all the replicated public folders to another database by using the MoveAllReplicas.ps1 script. The MoveAllReplicas.ps1 script changes the server in the replica list for all public folders to another server. After the folders have been replicated, you can remove the public folder database from the Exchange 2010 server. If you delete replicated public folders before you move the public folders, the deleted public folders may replicate before the public folder database can be deleted. In this case, the public folder data is also deleted from the other databases. For more information, see Move Public Folder Content from One Public Folder Database to Another Public Folder Database.
Looking for other management tasks related to public folder databases? Check out Managing Public Folder Databases.
Use the Shell to delete user public folders
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Public folders" entry in the Mailbox Permissions topic.
Note
You can't use the EMC to delete user public folders.
This example removes all user public folders.
Get-PublicFolder -Server <server containing the public folder database> "\" -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server <server containing the public folder database> -Recurse -ErrorAction:SilentlyContinue
For detailed syntax and parameter information, see Get-PublicFolder and Remove-PublicFolder.
Use the Shell to delete system public folders
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Public folders" entry in the Mailbox Permissions topic.
Note
You can't use the EMC to delete system public folders.
This example removes all system public folders.
Get-PublicFolder -Server <server containing the public folder database> "\Non_Ipm_Subtree" -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server <server containing the public folder database> -Recurse -ErrorAction:SilentlyContinue
For detailed syntax and parameter information, see Get-PublicFolder and Remove-PublicFolder.