How to Remove Last Public Folder from Exchange?

Shelly Bhardwaj
5 min readFeb 8, 2022

Summary: You can’t remove a database from the Exchange Server before removing the arbitration or system mailboxes. In this post, we’ll be explaining the step-by-step process to remove public folder database from Exchange. If you’ve removed the database and missed exporting any mailboxes or public folders, you can use the EDB converter tool mentioned in this post to export them.

In Exchange Server, all the data is stored into databases. Also, public folders have a database for them. When you have made a migration from one Exchange Server to another or you are splitting the data between two databases, you need to remove the source database. In Exchange Server, you cannot simply remove a database from the server. If you do, you will get an error saying that the database is not empty and contains one or more items in the database (see the error message below).

“This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes, Audit mailboxes. To get a list of all mailboxes in this database, run the command Get-Mailbox -Database. To get a list of all mailbox plans in this database, run the command Get-MailboxPlan. To get a list of archive mailboxes in this database, run the command Get-Mailbox -Database -Archive. To get a list of all public folder mailboxes in this database, run the command Get-Mailbox -Database -PublicFolder. To get a list of all arbitration mailboxes in this database, run the command Get-Mailbox -Database -Arbitration. To get a list of all Audit mailboxes in this database, run the command Get-Mailbox -Database -AuditLog. To disable a non-arbitration mailbox so that you can delete the mailbox database, run the command Disable-Mailbox. To disable an archive mailbox so you can delete the mailbox database, run the command Disable-Mailbox -Archive. To disable a public folder mailbox so that you can delete the mailbox database, run the command Disable- Mailbox -PublicFolder. To disable Audit mailbox so that you can delete the mailbox database, run the command Get-Mailbox -AuditLog | Disable-Mailbox. Arbitration mailboxes should be moved to another server; to do this, run the command New-MoveRequest. If this is the last server in the organization, run the command Disable-Mailbox -Arbitration -DisableLastArbitrationMailboxAllowed to disable the arbitration mailbox. Mailbox plans should be moved to another server; to do this, run the command Set-MailboxPlan -Database.”

This also occurs even if you have already moved all the mailboxes or folders using the new-MoveRequest PowerShell command from your Exchange Management Shell (EMS).

After you have moved all the data, you cannot remove the database in question before removing or disabling the arbitration or system mailboxes. Once this is done, you can remove the mailbox/public folder database.

Methods to Remove a Database

There are two methods to remove a database from your Exchange Server system.

Method 1: Using the PowerShell command Set-MailboxDatabase. This is the recommended way to clean up a database before removing it.

Method 2: Using ADSIEdit.msc from the command prompt. This will allow you to remove the Exchange Server database without removing the system and arbitration mailboxes. This may sound easy and quick. However, when using the ADSIEdit.msc, you are modifying the Active Directory Schema and there is no undo button. So, it’s recommended to be sure on what you are doing and triple check your work and make sure that you have a backup of your Active Directory servers as the repercussions can be catastrophic to the system. Apart from damaging the Exchange Server configuration (since most of the configuration is stored in the schema), you might also impact other applications and system in your infrastructure.

So, let’s explore these methods.

1. Remove the System Mailboxes using Get-Mailbox Command

It’s always important to go with the recommendation. This needs to be done as although you moved all folders/mailboxes to another database, the database might still contain one or more of the following.

- Arbitration mailboxes

- Monitoring system

- Audit logging

- Public Folders

- Archives

By running the Get-Mailbox, you can identify what your mailbox has (see the example below).

Get-Mailbox -database “<Database Name>”

Get-Mailbox -database “<Database Name>” -archive

Get-Mailbox -database “<Database Name>” -arbitration

Get-Mailbox -database “<Database Name>” -publicfolder

Get-Mailbox -database “<Database Name>” -monitoring

Get-Mailbox -database “<Database Name>” -auditlog

If one of the above is detected, you need to move it to another database. This can be done by using the New-MoveRequest command as given below.

Get-Mailbox -Database “<Source Database Name>” -<Item in question> | new-moverequest –targetdatabase “<Destination Database Name>”

After this, you will be able to remove the database from the system. But if this is the last public folder and you cannot move it to another database, the alternative is to use the ADSIEdit.msc method.

2. Use ADSIEdit.msc

You can use the ADSIEdit.msc to remove database from the system. Follow these steps:

- Right-click on Start.

- Click on Run and type ADSIEdit.msc.

- Open Configuration/Configuration Services.

- Open Microsoft Exchange/ <Your Organization>.

- Open Administrative Groups and Exchange Administrative Groups.

- Open Databases and delete the desired databases from the list.

This will remove all the mailbox and public folder databases from the system.

To Conclude

Now, if you have missed to move any public folders or export them for safe keeping, once removed, there is no way to export them. For this reason, you need Stellar Converter for EDB. This EDB to PST Converter software can open multiple EDB files of any Exchange Server version, browse through them, and export to PST and other formats. You can also export directly to another live database or even export directly to an Office 365 tenant.

--

--

Shelly Bhardwaj

I am a Product Consultant and is associated with Stellar Data Recovery from last 8 years. I write about Exchange Server, Office 365, Outlook, and other topics.