Applies to: Exchange Server 2007
Topic Last Modified: 2009-09-01

Use the Remove-PublicFolderDatabase cmdlet to delete public folder databases.


Remove-PublicFolderDatabase -Identity <DatabaseIdParameter> [-DomainController <Fqdn>] [-RemoveLastAllowed <SwitchParameter>]


Parameter Required Type Description




The Identity parameter specifies a public folder database. You can use the following values:

  • GUID

  • Distinguished name (DN)

  • Server\storage group\database name

  • Server\database name

  • Storage groupname\database name

If you do not specify the server name, the cmdlet will search for databases on the local server. If you have multiple databases with the same name, the cmdlet will retrieve all databases with the same name in the specified scope.




To specify the fully qualified domain name (FQDN) of the domain controller that writes this configuration change to the Active Directory directory service, include the DomainController parameter in the command.




If included, the RemoveLastAllowed parameter enables removal of the last public folder database in the organization.

Detailed Description

Removing a public folder database can have a broad range of serious consequences. (This is particularly true when removing the last public folder database in the organization.) For a detailed discussion about the effects of removing a public folder database and guidance on best practices, see How to Remove a Public Folder Database.

If you want to remove the last public folder database on a specific Exchange 2007 server, you must move all the replicated public folders to another database by using the MoveAllReplicas.ps1 script. The MoveAllReplicas.ps1 script changes the server in the replica list for all public folders to another server. After the folders have been replicated, you can remove the public folder database from the Exchange 2007 server. If you delete replicated public folders before you move the public folders, the deleted public folders may replicate before the public folder database can be deleted. In this case, the public folder data is also deleted from the other databases.

To use the Remove-PublicFolderDatabase cmdlet, the account you use must be delegated the following:

  • Exchange Organization Administrator role

For more information about permissions, delegating roles, and the rights that are required to administer Microsoft Exchange Server 2007, see Permission Considerations.

Input Types

Return Types


Error Description



Exceptions Description



This example demonstrates how to remove the database named "MyServer\Second Storage Group\Public Folder Database" after all the prerequisites for removing the database have been satisfied.

Copy Code
Remove-PublicFolderDatabase "MyServer\Second Storage Group\Public Folder Database"