• 1. London, UK
  • 2. New York, NY
  • 3. Sydney, Australia
  • 4. Melbourne, Australia
  • 5. Paris, France
  • 6. Bangalore, India
  • 7. Amsterdam, Netherlands
  • 8. San Francisco, CA
  • 9. Hong Kong
  • 10. Houston, TX

Monday, May 05, 2008

 

HOW TO: Remove the Public Folder Store

Posted by Bharat Suneja at 11:22 AM
This is a fairly common question - you're trying to remove the Public Folder store on an Exchange 2007 server and get an error that some Public Folder replicas still exist. You're certain you've removed all Public Folder replicas from that server. What next?

Here's a little procedure documented in How to Delete Multiple Public Folders from Your Organization that takes care of this.

Note: This procedure should be performed only if you're removing the last (or only) Public Folder Store from an Exchange Organization. If there are other servers in the Organization that also host Public Folders, using this procedure removes the folders from the Public Folder hierarchy.

1 Remove all Public Folder replicas from the server using the following command:

Get-PublicFolder -Server "SERVER NAME" "\" -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server "SERVER NAME" -Recurse -ErrorAction:SilentlyContinue

2 Next, remove all System Folders using the following command:

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

3 To verify all Public Folders have been deleted:

Get-PublicFolderStatistics -Server "SERVER NAME" | fl

At times the replica clean-up may take a little while. If you still see replicas after running this command, run it again in 10-15 minutes.

Removing Public Folder replicas using MoveAllReplicas.ps1

If Public Folders are hosted on more than one server, use the MoveAllReplicas.ps1 script to remove replicas from a server, as illustrated in KB 927464: How to remove Exchange 2007 from a computer.

The MoveAllReplicas.ps1 script resides in the Scripts folder in the path where Exchange Server 2007 is installed. It's an easy-to-use script that takes 2 parameters— the source and target server names. The source server is the server you're trying to remove the Public Folder replicas from. The target server can be any other server in the Organization that hosts Public Folders— presumably a server that's in the same location to avoid replicating PFs over WAN links.

MoveAllReplicas.ps1 -Server "SOURCE SERVER NAME" –NewServer "TARGET SERVER NAME"

Once this is done, it may take some time for Public Folders to replicate to the target server, and for these to be removed from the source server. To verify there are no replicas on the source server, you can use the Get-PublicFolderStatistics command.

Labels: , ,

9 Comments:

January 20, 2009 1:07 PM
Anonymous Anonymous said...

Thank you very much!! After much frustration, this solved my problem!! Namaste!

 
February 6, 2009 3:15 PM
Anonymous Anonymous said...

I have a similar issue. We have two Exchange servers. Both have Public Folders. I have to decommission one server. I have suspended the replication and applied the move all replicas script from the server that is leaving.
I have pointed the mailbox from First Storage to point to the Public Folder database of the server that is staying. I also pointed it on the server that is not staying.
I need to uninstall the server, but the mailbox role will not uninstall until I clear the replicas.
After applying the scrip a day ago, there are some replicas still in the old server thus the uninstallation is not possible. What can I do now?
Any help would be appreciate it.

 
March 6, 2009 7:48 AM
Anonymous Richard (MS Exchange Support) said...

Please move the note that says to only do this if this is the only PF store to be BEFORE the powershell commands to use Remove-PublicFolder.

I'm currently on a support call with a customer who had someone that was trying to remove a 2007 Mailbox server most likely do this in their environment and deleted the whole PF tree. We're now in the process of trying to recover folders.

 
March 6, 2009 8:39 AM
Blogger Bharat Suneja said...

@Richard: Thanks for pointing out. The note has been moved before the procedure.

 
March 16, 2009 8:57 AM
Blogger Darwin Observer said...

Does the "Remove" delete the instance from only the server you apply this to? Or does it try to delete it from all servers.

I ask because some of the wording in E2k7 means something different. Like Remove when right clicking a mailbox. (it deletes the user, too.)

i have a CCR that had a PF database installed at setup. I want to remove it but there are system folders on it. no one is on the 2k7 boxes yet.

 
March 16, 2009 9:15 AM
Blogger Bharat Suneja said...

@Darwin: As noted in the post—
If there are other servers in the Organization that also host Public Folders, using this procedure removes the folders from the Public Folder hierarchy."

 
May 8, 2009 3:52 AM
Anonymous Anonymous said...

Hi, I made the exact same mistake as Richard in the above post describing. Needed to remove from one server, but wiped out the whole hierarchy on all servers. We've run a restore, and replication deleted it again. We set the replication on all stores to "never run", but after about 12 hours, it deleted it again. Anyone got a good idea?

Thanks

 
July 30, 2009 2:19 PM
Anonymous Anonymous said...

ok,

im in a migration from exchange 2007 to exchange 2007 server, i used the MoveAllReplicas.ps1 and all folders are on the new server. but how to go on now? which steps do i have to take to remove the old public folder database without removing files on the new server?

tnx in advanxce.

greetz styler

 
February 3, 2010 1:27 PM
Anonymous Anonymous said...

I'm in the same boat - I followed this script on another page and was not aware this would wipe out the entire Public Folder hierarchy.

does anyone know how to un-do what this command does? We are running Exchange 2003 as our primary server and have lost the Public Folders in Exchange. The database files are still there, but there's nothing showing up in Exchange System Manager or Outlook

Please let me know if you have any ideas on this - I'm awaiting a call back from Microsoft at the moment, but it will be several hours before I hear back

Nick

 

Post a Comment

Links to this post:

Create a Link

<< Home