none
How to Remove Public Folder Replicas?

    Question

  •  I am unable to remove the Public Folder Database . Every time I try, I get the error: 

       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. 

    The public folder database has no Public Folders in it - it is completely empty. I've set replication to "Never" but I still get this error. The UI does not expose the replica list and the set-PublicFolder command does not have a provision for having an empty parameter for the -Replicas switch.  

    I can't just simply delete the database itself since then the Exchange Uninstall will fail the pre-checks and won't uninstall and I need the roles removed, etc. from the registry. 

    Any help on this would be greatly appreciated.
    Thursday, October 13, 2011 9:05 AM

All replies

  • Hi,

    Try to use the moveallreplicas.ps1 script. This should remove the server name on all replicas.

    http://technet.microsoft.com/en-us/library/bb331970.aspx

    Leif

    Friday, October 14, 2011 8:29 AM
  • Hi
    To use the Exchange Management Shell to remove a public folder database

    Move any public folder replicas to another server, as described in the preceding procedure, or delete all the folders in the database by running both of the following commands:

    Get-PublicFolder -Identity \ -GetChildren | Remove-PublicFolder -Recurse

    Get-PublicFolder -Identity \ Non_Ipm_Subtree -GetChildren | Remove-PublicFolder -Recurse

    To use the Exchange Management Shell to remove a public folder database, run the following command:

    Remove-PublicFolderDatabase -Identity "My Public Folder Database"

    To remove the last public folder database in an organization, run the following command:

    Get-PublicFolderDatabase | Remove-PublicFolderDatabase –RemoveLastAllowed

    Friday, October 14, 2011 8:31 AM
    Moderator
  • as there is only one Exchange server, so I don't need to move replicas to another server . just implement the above all commands that is ok?
    Friday, October 14, 2011 9:22 AM
  • yeah

    Friday, October 14, 2011 9:24 AM
    Moderator
  • this command can't be run as some errors Get-PublicFolder -Identity \ Non_Ipm_Subtree -GetChildren | Remove-PublicFolder -Recurse
    Tuesday, October 18, 2011 9:18 AM
  • Tuesday, October 18, 2011 9:28 AM
  • I faced this issue (Unable to remove emptied unused PF Database) as well in Exchange 2007 using EMC or EMS.

    At first, we checked at the OAB to make sure "Enable public folder distribution" is not ticked.

    Anyhow, the emptied unused PF Database has been removed successfully through ADSIEdit.

    Bear in mind, it is not recommeded to use ADSIEdit if you are not sure what to remove.

    Thursday, October 20, 2011 7:42 AM
  • I had this problem too, MoveAllReplicas.ps1 worked with no errors
    Still I could not remove the server or its public folder databases.

    My workaround:
    - Dismounted the public folder database
    - Renamed/moved its files (ebd+log)
    - Mounted the database and said "yes" to the recreate warning

    Now you have an empty database that can be removed
    • Proposed as answer by Albert Gotink Tuesday, October 25, 2011 9:18 AM
    Tuesday, October 25, 2011 9:18 AM
  • had the same issue with this script as kenaska.  Use the Microsoft suggested commands on this page to remove both user and system public folders, and then you can remove the database.  http://technet.microsoft.com/en-us/library/bb201664%28v=exchg.140%29.aspx

    User Public Folders:

    Get-PublicFolder -Server <server containing the public folder database> "\" -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server <server containing the public folder database> -Recurse -ErrorAction:SilentlyContinue

    System Public Folders:

    Get-PublicFolder -Server <server containing the public folder database> "\Non_Ipm_Subtree" -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server <server containing the public folder database> -Recurse -ErrorAction:SilentlyContinue

    This worked to resolve my issue. 

    Wednesday, March 14, 2012 12:37 AM
  • had the same issue with this script as kenaska.  Use the Microsoft suggested commands on this page to remove both user and system public folders, and then you can remove the database.  http://technet.microsoft.com/en-us/library/bb201664%28v=exchg.140%29.aspx

    User Public Folders:

    Get-PublicFolder -Server <server containing the public folder database> "\" -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server <server containing the public folder database> -Recurse -ErrorAction:SilentlyContinue

    System Public Folders:

    Get-PublicFolder -Server <server containing the public folder database> "\Non_Ipm_Subtree" -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server <server containing the public folder database> -Recurse -ErrorAction:SilentlyContinue

    This worked to resolve my issue. 

    ---------------- STOP --------------------  DO NOT TRY THIS UNTIL YOU HAVE READ THIS 

    http://blogs.technet.com/b/bill_long/archive/2011/06/11/do-not-use-remove-publicfolder-to-remove-a-public-folder-database.aspX

    AND FULLY UNDERSTOOD THE CONSEQUENCES.


    Sharique 'W@rbuG' Ahmed. 2 b or not 2 b

    Tuesday, March 27, 2012 1:54 AM
  • Thank you. After following your steps above I was able to delete the Public Folder database.
    Wednesday, January 15, 2014 7:23 PM
  • And perhaps lost some public folder content in the process.

    While what you did is acceptable if you understand why you had to do it, it's not really a good idea to use this method. Sure, it works . . . but would you chop off one of you toes just because it itched???


    --- Rich Matheisen MCSE&I, Exchange MVP

    Friday, January 17, 2014 11:08 PM