Removing public folder from Exchange 2007 Server

In Exchange life cycle we always bring in new Exchange servers and some times remove the old exchange servers. Some times decomission of exchange servers is bit challanging but really noting to worry. As you whould moved most of the users out and there will be no impact.

Once you remove public folder then most of the decomission goes smooth. Removing public folder some times can be bit tricky, in fact most of the time we have to fight with PF to remove it. Before removing the public folder you need to make sure that you remove all the replicas for that public folder Database.

This commands helps you get the list of all the public folder and there replicas

Get-publicfolder \ -recurse |ft Name,Replicas

This commands gets you all the system folders replicas

Get-publicfolder \NON_IPM_SUBTREE -recurse |ft Name,Replicas

If you wanted to move all the replica pointing from the decomission server to new server then below command does it all. Once you run this command you need to wait for some time. Time may vary, it can take few hours to days depending on the size of public folder.

.\MoveAllReplicas.ps1 -Server MySourceServer -NewServer MyTargetServer

If you dont wanted move the replica and some times all the pf folder will share the replica and it really does not make sense to move the replica to the database which already exists. Then you may wanted to use removereplicafrompfrecursive powershell script which is available in scripts, to remove all the replica for the server. Again it needs some time for the replication.

RemoveReplicaFromPFRecursive.ps1 –TopPubicFolder “\” -servertoRemove <servername>

Once all the replicas are romoved then you can delete public folder database using below command. Before that you also need to make sure that Mailbox database is not pointing to this PF database which you are removing

Get-publicfolderdatabase -server <decomservername> | remove-publicfolderdatabase

One thought on “Removing public folder from Exchange 2007 Server

  1. Hi Krishna,
    nice work summing up the commands and scripts, quite helpful.
    I have a question though, in my scenario mail sent to mail enabled public folders remained in delivery queue on the Hub servers.
    The queue is for a mailbox servers that we decommissioned recently.
    Can you please advise what should I do in order to stop mails routing to that queue?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s