skip to Main Content

Cannot delete mailbox database Exchange 2016

You cannot delete mailbox database in Exchange 2016 and an error is showing. Error: This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes. Why is that happening and what is the error telling?

In this article, you will learn why you cannot delete a mailbox database and the solution to the error.

Cannot delete mailbox database solution

The solution to the error is to make sure that there are no mailboxes in the database. If there are mailboxes in the database, you are not granted to delete the mailbox database in Exchange Server. You have to check all the mailboxes one by one in the mailbox database and move them to another database.

Cannot delete mailbox database Exchange 2016 error

Error this mailbox database contains one or more mailboxesError: 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 <Database ID>. 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 <Database ID> -Archive. To get a list of all public folder mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -PublicFolder. To get a list of all arbitration mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -Arbitration. To get a list of all Audit mailboxes in this database, run the command Get-Mailbox -Database <Database ID> -AuditLog. To disable a non-arbitration mailbox so that you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID>. To disable an archive mailbox so you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID> -Archive. To disable a public folder mailbox so that you can delete the mailbox database, run the command Disable-Mailbox <Mailbox ID> -PublicFolder. To disable a 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 <parameters>. If this is the last server in the organization, run the command Disable-Mailbox <Mailbox ID> -Arbitration -DisableLastArbitrationMailboxAllowed to disable the arbitration mailbox. Mailbox plans should be moved to another server; to do this, run the command Set-MailboxPlan <MailboxPlan ID> -Database <Database ID>.

Before starting to move mailboxes to another database

Important: Before you move the mailboxes, run the Set-ADServerSettings cmdlet including the -ViewEntireForest parameter. This will let you view the objects in the entire forest.

Check databases

Do you know to which database you are going to migrate the mailboxes too? Check mailbox database mount status in Exchange Server. Run the Get-MailboxDatabase cmdlet.

Move mailboxes to another database

In our example, we are going to delete the mailbox database DB01. Before we can do that, we need to move the mailboxes. We are going to move all the mailboxes to the mailbox database DB02. The monitoring mailboxes associated with the mailbox database DB01 will be disabled.

Mailbox

Run Get-Mailbox to find all mailboxes in the database that you are going to delete.

Move all mailboxes from one database to another with the New-MoveRequest cmdlet.

Mailbox Plan

Mailbox plan is not relevant for on-premises Exchange environments. It’s only available in cloud-based service.

A mailbox plan is a template that automatically configures mailbox properties in Exchange Online. Mailbox plans correspond to Office 365 license types. When you assign a license to a new user, the corresponding mailbox plan is used to configure the settings on the new mailbox that’s created. If you change the license that’s assigned to an existing user, the settings in the mailbox plan that’s associated with the new license are applied to the user’s existing mailbox.

Archive mailbox

Find archive mailboxes in the database.

Move archive mailboxes to another database.

Public folder mailbox

Find public folder mailboxes in the database.

Move public folders mailboxes to another database.

Arbitration mailbox

Find arbitration mailboxes in the database.

Move arbitration mailbox to another database.

Audit Log mailbox

Find audit log mailboxes in the database.

Move audit log mailboxes to another database.

Monitoring mailbox

Microsoft has not written in the error log to find and move monitoring mailboxes in the database. The best practice is to not move the monitoring mailboxes between mailbox databases. In my experience, it’s best to find the monitoring mailbox and disable them. If you don’t, you get a warning after deleting the mailbox database. Also, the health mailboxes will be in a corrupt state. Read the article, check Exchange health mailboxes.

Find monitoring mailboxes associated with the mailbox database.

Disable monitoring mailboxes.

Verify mailboxes move

Verify that all the mailboxes are moved. After that, remove completed move requests. If you don’t, you will get the error this mailbox database is associated with one or more move requests. If you want to remove all move requests, run the third command.

Remove the mailbox database

Log in to the Exchange Admin Center. Click servers in the feature pane and click the databases tab. Select the database that you want to dismount in the list view. Click the More … icon in the toolbar and click Dismount.

Cannot delete mailbox database Exchange 2016 dismount database

After dismounting the database. Select the database in the list view and click the delete icon in the toolbar.

Cannot delete mailbox database Exchange 2016 delete mailbox database

A warning will show if you are sure to delete the database. Click Yes.

Another warning message is showing that the specified database has been removed. Note that we have to remove the database file from the system manually.

Start File Explorer on the Exchange Server and go to the location of the database. Delete the database and the logs folder.

Read more: Pause all mailbox move request in Exchange »

Conclusion

You learned why you are getting an error and cannot delete a mailbox database in Exchange 2016. Use the above commands to move all mailboxes to another database. After that, delete the mailbox database in Exchange Server. As of last, delete the mailbox database and log files manually in File Explorer.

Did you enjoy this article? You may also like Enable circular logging Exchange 2016. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 4 Comments

  1. Great Guide – one thing missing though. You also need to clear down any mailbox export reports if any exist.

    Get-MailboxExportRequest | Remove-MailboxExportRequest

    1. I tried to reproduce the issue, but I can’t confirm.

      What I did:
      Export a mailbox that’s located on DB01 to PST file
      Run the cmdlet Get-MailboxExportRequest
      The mailbox export status shows as completed
      I did not clear the mailbox request
      Follow the steps in this article
      Delete mailbox database DB01
      The mailbox database is deleted without any error
      Run the cmdlet Get-MailboxExportRequest
      The mailbox export request still shows as completed

      Your suggestion might work for other readers. Thank you for letting us know.

  2. I have done all checking and the database cannot be deleted even though there are no mailboxes, archives, arbitration, monitoring, etc. it says there are multiple copies, but there is only one server of two that has mailbox related files. I manually deleted the .edb file but the system still thinks there are multiple copies of the database and won’t allow me to delete it.

Leave a Reply

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

Back To Top