Tuesday, January 30, 2007

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:

14 Comments:

At 8:39 PM, Blogger Wings said...

Hi Jim..thanks for the post but I am still getting the same old message ... any clue??? :-(

 
At 12:26 PM, Blogger Andy said...

Great stuff, Jim; I had a PF database that I created and immediately tried to delete, with no joy. I was scratching my head trying to figure out how to delete the system folders from it so I could get rid of it; your cmdlets were the solution- thanks!

Andy

 
At 9:11 PM, Blogger Brandon said...

I have run these commands and was able to remove everything except my Offline Address Book and Schedule+ Free. Anyone know why or how to get these off the server?

 
At 9:26 AM, Blogger Resendes said...

Great Jim, great solution...

Thanks!

 
At 1:49 PM, Blogger Hung Pham said...

great JIm, it works for me this time. You missed a character in the second command:

Get-PublicFolder -Server servernamehere "\Non_Ipm_Subtree" -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server servernamehere -Recurse -ErrorAction:SilentlyContinue

 
At 7:39 AM, Blogger Chris Wallace said...

Jim, I've been reading your stuff since Exchange 2000. Many thanks for taking the time to help out with great tips on keeping Exchange healthy and improving the knowledge base for a great but complex product.

 
At 8:18 AM, Blogger Dave said...

Great Stuff indeed, I'm not a expert exchange so I was very relieved when I saw this. Many Thanks! It worked for me, only there was missing an character like Hung pham said.

Dave B

 
At 2:14 PM, Blogger themonkman said...

Strangely enough, I can't find the Get-PublicFolder script in my \scripts directory or anywhere else on my Exchange 2007 server. Is there an additional script pack that one has to download from Microsoft?

 
At 7:41 AM, Blogger introtologic said...

I had to use ADSI Edit to delete the database when above or any other commands did not work.

 
At 7:16 AM, Blogger Gregory G said...

Fantastic! That was really annoying problem. With addition of | characters to _both_ commands it did the trick at last. Thank you.

 
At 12:32 PM, Blogger Josh said...

Both commands are missing the "|" pipe to direct stdout to stdin

 
At 2:29 AM, Blogger havewings said...

Jim,
Thanks for the help. You gave a fair warning of it deleting all public folders. Will this remove public folders in Exchange 2003 if it is co existing with Exchange 2007. I have moved all replica back to Exchange 2003.

Richard

 
At 11:39 PM, Blogger pamela said...

thanks. worked for me

 
At 4:35 PM, Blogger stealthbits said...

Hi friends,

The process for removing a public folder database requires several steps. Because this process is different if you are removing the last public folder database in your organization. Removing a public folder database from a server, if you want to move a public folder database from a server. You must first move the data within the public folder database to a public folder database on another server, and then you remove the public folder database. Thanks a lot...

SMP For SQL

 

Post a Comment

<< Home