Home » Exchange Server » How to Remove an Exchange 2010 Public Folder Database

How to Remove an Exchange 2010 Public Folder Database

Before you can uninstall Exchange Server 2010 from a server you must remove all databases, including public folder databases.

A public folder database can’t be removed until it no longer hosts any public folder replicas.  If you try to remove it while it still hosts replicas you’ll receive an error message.

Exchange 2010 public folder database can’t be removed

——————————————————–
Microsoft Exchange Error
——————————————————–
The public folder database ‘PF-BR-01’ cannot be deleted.

PF-BR-01
Failed
Error:
The public folder database “PF-BR-01” contains folder replicas. Before deleting the public folder database, remove the folders or move the replicas to another public folder database. For detailed instructions about how to remove a public folder database, see http://go.microsoft.com/fwlink/?linkid=81409&clcid=0x409.

——————————————————–
OK
——————————————————–

Microsoft has provided some PowerShell scripts with Exchange Server 2010 for public folder management. They are located in the Scripts folder of the location that Exchange is installed.

Launch the Exchange Management Shell and run the following command to navigate to the Scripts folder.

Now inspect the public folder replicas to see whether the public folder database you’re trying to remove is the only replica, or if there are other replicas as well.

As you can see above the PF-BR-01 public folder database is the only replica for a few of the public folders. If the folders are no longer needed they can simply be deleted. Otherwise we need to move those replicas to another public folder database if we want to keep those folders. The MoveAllReplicas.ps1 script is provided for this task.

You may need to wait a while for this change to take effect depending on how many replicas you’re trying to move.

You also need to ensure that no mailbox databases are configured to use that public folder database. You can check this quickly using the following command.

If the public folder database doesn’t appear in the list then no mailbox databases are using it.

You’ll also need to make sure that the server is not the OAB generation server for any Offline Address Books that are also being published to public folders.

If necessary move the OAB generation to another mailbox server.

You can also disable public folder distribution of the OAB if you no longer have Outlook 2003 clients on the network.

Finally, if you have multiple public folder servers in your environment check whether there are custom public referral lists configured on any of them. If you remove a public folder database that is in another server’s custom referral list it can cause an error that the public folder store is in an inconsistent state.

Once all of these conditions have been met you should be able to remove the public folder database.

If you still can’t remove it and you’re sure the public folder database contains no more replicas you can use ADSIEdit to remove the public folder database from the organization.

Removing Exchange 2010 public folder database with ADSIEdit.msc
Paul is a Microsoft MVP for Office Servers and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul is a co-author of Office 365 for IT Pros and several other books, and is also a Pluralsight author.
Category: Exchange Server

70 comments

  1. Kevin says:

    Man… you rock.

    Took me forever to fidn this, but once I did I was finally able to uninstall my broken exchange 2010 installation.

    Thank you!!!!!!!!!!!!!!!!!!! A million Times Thank you

  2. GzBz says:

    Why not just search for any Public Folder with the specified server as a replica?

    Get-PublicFolder -Recurse -ResultSize Unlimited | where {$_.replicas -like “*server01*”}

    For orgs with a ton of PFs this makes life much easier. Good stuff, thanks

  3. awol says:

    U ARE THE MAN!!!!
    Spent hours and hours running scripts to try and remove a server that had been offline for months. MS make it rocket science to perform a simple every day task with no “what if” fallback scenarios, like “what if the server cannot replicate anymore?!”

  4. mike says:

    I think I mad a mistake some where are I have used ADSIEdit to remove the public folder but now one of my mailboxes in in a unknown state this it fresh install so no data in the mailbox but I cannot remove the mailbox and create a clean install

    can anyone help?,

  5. Richard Chan says:

    Greeting Paul, I’ve bookmarked all your articles and feel all your articles are very helpful to all of us. However, I do need some advice about removing a Public Folder from a 4 mailboxes DAG. Scenario is that one of the mailboxes didn’t have a Public Folder configured, so I’ve tried to configure it like I did the others. To my surprise, the Public Folder was created and not mounted. It mentioned something about the mailbox id. So the “created” Public Folder is showing as Dismounted. I logged into the server that the Public Folder didn’t mount and found that there were path to two different mailboxes. I didn’t know that when I tried to create the Public Folder, so it was attempting to create the Public Folder on the mailbox that was no longer used. I tried to remove the Public Folder from the EMC but got the error message “Exchange isn’t able to check for public folder replicas for “Public Folder XXXX” Verify that the Microsoft Information Store” is running on XXXX. Paul, any suggestion?

  6. Ahmed Kilic says:

    hello Paul, thanks for the article. I deleted Public Folder Database with your explanation from ADSIEDIT. but I think when I deleted Public Folder DB it was Mounted state. and now I can’t add a new Public Folder Databse. I get this error:
    Event: 9677
    Public Folder Database “Name” cannot be mounted because there is another public folder database from the same public folder tree already mounted. Erroro – 80004005
    How can i parmanently delete old Public Folder

  7. Khai says:

    Hi Paul – After manually deleting the Public Folder database from adsiedit

    Getting Event ID 3043 logged with the following message

    Error 0x972 occurred while performing a site folder check for public folder store “Public Folder Database 1486425264”

    Any ideas??

  8. Khai says:

    Another note ran EXBPA and getting this error “The site-wide public folder database for administrative group ‘Exchange Administrative Group (FYDIBOHF23SPDLT)’ has been deleted” did I really mess things up?

    • Khai says:

      I cleared the “siteFolderServer” attribute on CN=Exchange Administrative Group (FYDIBOHF23SPDLT) to clear the error in EXBPA

  9. Kottees says:

    Paul,

    I’ve changed the OAB generation server from PF1 (2010) server to PF2 (2010). But couldn’t change the OAB Public Folder Database. It is still pointing to the old one, PF1 database still exist.

    If I take PF01 offline will it pick it automatically or can we do it through adsiedit.

  10. Jeff says:

    Great info here. I went through and followed it very well…At least I thought I did. I get this error when running the search script.

    No existing ‘PublicFolder’ matches the following Identity: ”. Make sure that you specified the correct ‘PublicFolder’
    Identity and that you have the necessary permissions to view ‘PublicFolder’.
    + CategoryInfo : NotSpecified: (0:Int32) [Get-PublicFolder], MapiOperationException
    + FullyQualifiedErrorId : F093BF67,Microsoft.Exchange.Management.MapiTasks.GetPublicFolder

    I also cannot view the exchnage server through ADSI Edit.

    Any help would be well appreciated.

    Jeff

  11. Kent says:

    I’ve migrated what I think is everything from Exchange 2010 -> Exchange 2013. It still says there are replicas on the Exchange 2010 server. How can I be absolutely sure that everything is now on the 2013 server before I decommission the 2010 server? Thanks!

  12. Phil Ready says:

    How can I set an email address policy for Mail Enabled Public Folders in Exchange 2013? The EAC only seems to apply to Mailboxes and want me to set it by OU.
    I am guessing in the shell I can use set-mailpublicfolder
    Thanks
    Phil

  13. vadim says:

    Helpful, as always, not exhaustive, though (also, as always :-)). At least in certain cases (if not all) search for replicas might not show all the replicas existing. Running full search script is almost impossible to read if you have a lot of PFs on more than three servers (the line of PBs names is extending beyond the PS windows and is not wrapping). That one indeed is more convenient in this case: Get-PublicFolder -Recurse -ResultSize Unlimited | where {$_.replicas -like “*server01*”}.

    But neither will show replicas of Offline Address Book or Free/busy schedules, for instance. Luckily it can be seen and taken care of from the GUI of PF management console. You can easily see those replicas and remove replication there even when PS search script above does not show any replicas left. (Maybe these scripts don’t search System Folders at all).
    On the side note this PF affair is another sloppy bug causing inordinate efforts to perform what should be (and was in the past) a basic task.

  14. vadim says:

    BTW, after spending hours on this (we have literally hundreds of PF), running scripts and then verifying all of it through the GUI I still would get the same error stating there are some replicas on DB. Could not find any in any way, so finally resorted to ADSI. Still waiting for some possible issues/error to appear. In Auto industry they used to call products like that a ‘lemon’. Seems not anymore – I guess they took it after IT industry where its simply a norm :-).

  15. Tvuil says:

    My workaround:
    – Dismounted the public folder database
    – Renamed/moved its files (ebd+log)
    – Mounted the database and said “yes” to the recreate warning
    -Delete Public Folder Database

    Test ok with exchange 2010 and 2012

    • Paul says:

      I tried Tvuil’s suggestion as I really don’t want to be messing with Active Directory directly as soon as I did this and tried to delete it claimed it had replicas.

      Weirdly in powershell all it displays when I do Get-PublicFolder -Recurse | ft name,parentpath,replicas is IPM_SUBtree line.

      On dismounted the newly created public folder and running the exact same command then all the correct public folders show.

      Any ideas would be greatly appreciated as I need to get this server decommissioned asap.

    • Nigel Harvey says:

      Cracking solution Tvuil – I had a stand alone PF generated so we could do a selective data restore and once done couldn’t get rid of it because Exchange 2010 had already decided it would replicate to existing PF databases despite other settings.

      Was looking at ADSIEdit but gave your solution a shot first – result! – legal removal of a dead database.

      Many thanks again 🙂

  16. Harry says:

    Hi Paul when try to run “MoveAllReplicas.ps1” i gets following error

    You must specify a value with the replicas parameter.

    and replicas not being moved to new server hence old wont let me delete publicfolders database .

    any idea about above error.
    thanks Harry

  17. Harry says:

    Hi Paul am running below
    .MoveAllReplicas.ps1 -Server dbsex1 -NewServer dbs-ex1

    below is what i gets as an error and its repeated for each public folder. just to mention all my public folders are migrated to exchange 2013 and being accessed from there , and i want to get rid of exchange 2010 server. thanks
    ————————————————

    You must specify a value with the Replicas parameter.
    + CategoryInfo : InvalidOperation: (NON_IPM_SUBTRE…YDIBOHF23SPDLT):PublicFolderIdParameter) [], SetRep
    licasEmptyException
    + FullyQualifiedErrorId : A21C6F7F

  18. Milton Lopez says:

    Are there any references in AD to Public Folder databases that need to be manually cleaned up after deleting the database object itself (other than the references to it in the msExchHomePublicMDB attribute of mailbox databases, that is)?

    • Harry says:

      not sure what I did was right way of doing to fix the issue, after using MS guides to migrate public folders from 2010 to 2013, pubilc folders were working fine on 2013 and I can access these fine,
      but when i go via 2010 public folder console on exchange server it was still showing me all folders there as well, so what i did is deleted all folders that were showing on 2010 console, and then tried deleting public folder database ,
      now public folder database is deleted and i got public folders working on 2013.

      seems all working ok. anyway its on my test bed and i will implement on live servers next week.

  19. Tim Baker says:

    I have migrated all mailboxes and public folders from one Exch2010 server to another. I’ve also confirmed with your commands above. I still can’t remove the original server PF database due to the ‘contains replicas’ error.

    If I dismount that PF database, mail delivery to mail enabled public folders on the new server stop. I was told that would no longer be a problem once I remove the old PF database.

    I can either dismount/rename/delete the old one, or remove it with ADSIedit. But I first wanted to see if you can confirm for me that mail delivery to Public Folders will indeed work again after removing the old server Public Folder database?

    Thank you, you are the Go-To source for Exchange management help.

    • I can’t really confirm anything for you because I have no visibility of your environment. I would suggest that you pursue more investigations into the issue preventing you from removing the PF database.

  20. Tim Aitken says:

    Hi All,
    I was having this problem removing the last Public Folder database from Exchange 2010 after migrating to Exchange 2013.

    I had followed all the steps to remove the public folder but still couldn’t remove it. Research eventually led me to this command (The last comment on this page: https://social.technet.microsoft.com/Forums/exchange/en-US/c1e51bd0-51e4-45d1-b1f6-e1eb5f2b4b2f/delete-last-public-folder-database):

    Set-OrganizationConfig -PublicFolderMigrationComplete $True

    After setting that I could successfully remove the public folder from the EMC on Exchange 2010.

    Hope this helps.

    Tim

    • Doodleman99 says:

      This worked for me!
      the DB wasn’t even showing in ADSIEdit only my new databases were there.
      i even tried unmounting, renaming the files and then remounting to force a recreation of a new DB but still no joy.

      many many thanks!

  21. Rob Coleman says:

    I am cleaning up our gargantuan Public Folder Database. I am moving all the selected folders to a database created for the purpose on a single server (Van-MB3). I am doing this by removing all of the replicas on the folders for other serves and adding a replica to this new database only. So far so good.

    I now want to delete the folders IN THIS DATABASE ONLY but keep the database alive as I am doing this in a rolling process and still have lots of folders to move to it.

    Is there a powershell command that will delete ONLY the folders in the Public Folder Database on this one server. (Van-MB3) and not interfere with the heirarchy . I can’t really delete one folder at a time because there are hundreds and hundreds of them.

      • Robert says:

        Thank You Paul. this was the obvious point that I needed confirmed:

        Paul Cunningham says

        June 12, 2015 at 10:03 am

        After you have removed the replica from that server it no longer holds a copy of that folder’s contents.

  22. Turbomcp says:

    Hi Paul
    First thanks again for all your hard work
    I was looking for something and stumbled across this article
    and noticed you have a small typo here:
    Move-OfflineAddressBook “Default Offline Address List”

    should be:
    Move-OfflineAddressBook “Default Offline Address Book”

    🙂

    Thanks again

  23. Turbomcp says:

    my mistake
    I think your right I forgot my environment was “pure” 2010 in migration I think the name is right(if it was migrated from 2007 to 2010 for example.

  24. Rob says:

    Discovered that this will work…..at least on Exchange 2010 SP3

    get-publicfolderstatistics -server -resultsize unlimited | remove-publicfolder

    I used the -whatif parameter on the end of this command to confirm that it would do what I wanted
    it to do and then ran the command without the -whatif parameter.

    I know this seems simple in retrospect but I had a similar situation go horribly wrong a few years back necessitating the restore from backup of several thousand public folders……I’m a little gun-shy now.

  25. Elie Abou Nader says:

    Thanks a Lot.
    i used the ADSI Edit to remove the database because i deleted all the public folders and still cant remove the database.

  26. Frank says:

    This worked for me:

    My workaround:
    – Dismounted the public folder database
    – Renamed/moved its files (ebd+log)
    – Mounted the database and said “yes” to the recreate warning
    -Delete Public Folder Database

    Test ok with exchange 2010

  27. Sunil says:

    Hi Paul,

    I removed PF association from mail box database & also have removed PF databases form ADSIEDIT, but still user are able to see in outlook.

    Any suggestion

  28. Sunil says:

    after removing PF database when I click on folder option on outlook. It is showing public folder with no data & when I click on it prompt me error

    cannot expand the folder. The public folder could not be opened because the organization you are connected does not support public folder.

    can you please tell me is this outlook folder.

  29. SS says:

    Hi Tim Baker,

    Where you able to get solution for your issue.. I am in the same situation as you.
    I wish to remove the One Exch 2010 PF server due to old hardware.
    Have replicated all the data to new server. If I stopped the services on the old server, mail are not getting delivered on the mail enabled PF.

    As soon as bring up the services on old server mails are delivered to PF.

    However if I see property of Mail enabled PF I don’t see the replica for this Old server.

    Any help will be appreciated.

  30. Tiana Westling says:

    I have a few questions that weren’t clarified in the instructions:

    I’m virtualizing our Exchange 2010 environment and need to migrate the PF’s from the physical to the new virtual. This is a 2010 to 2010 migration.

    1) Does it require us to first install a new, empty PF on the other server?
    a. If no, will it give us the ability to let us set the partitions we want the db and the logs to sit in, during the script run?
    2) Does it say there will be outage/downtime while this runs?
    3) Are there any caveats to replicating moderated and/or mail-enabled folders?

    Thanks in advance!!
    Tiana

  31. A.R. says:

    Thank you for a great article!
    In my case replica that did not allow to delete PF DB base was in system folders, not user ones.
    Get-PublicFolder non_ipm_subtree -Recurse | fl name,parentpath,replicas > system_folders.txt

  32. K.S says:

    Get-PublicFolder non_ipm_subtree -Recurse | fl name,parentpath,replicas

    Under Tools open public folder management and check replica information.
    Add the view if necessary
    Then remove your public folder database anywhere it is shown
    Once completed try removing the database again via the EMC
    Worked for me.
    Thankyou A.R

Leave a Reply

Your email address will not be published. Required fields are marked *