Removing all public folders from an Exchange 2007 server
I have just had to do some digging to solve one of the problems I am having. I am removing an Exchange Server 2007 server from my Exchange organization. I kept getting this error:
Mailbox Role Prerequisites
Error: Uninstall cannot proceed. Database 'Public Folder Database': 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.
I did a little research and found these commands. Thanks Navin Tah for the example! The server I am removing is named HNLEX04. I have to run the command twice. Once for the root of the public folder tree (the IPM_Subtree) and once for the system folders (NON_IPM_SUBTREE). Remember this will delete all of your public folders! Here are the two commands:
Get-PublicFolder -Server HNLEX04 "\" -Recurse -ResultSize:Unlimited Remove-PublicFolder -Server HNLEX04 -Recurse -ErrorAction:SilentlyContinue
Get-PublicFolder -Server HNLEX04 "\Non_Ipm_Subtree" -Recurse -ResultSize:Unlimited Remove-PublicFolder -Server HNLEX04 -Recurse -ErrorAction:SilentlyContinue
Labels: Exchange 2007