Exchange 2013 Database Removal Error: “This mailbox database contains one or more mailboxes”

When attempting to remove a database from an Exchange Server 2013 mailbox server you may encounter the following error.

Error attempting to remove an Exchange Server 2013 database

This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes.

This error can occur even on a brand new mailbox database that you have not migrated any mailboxes to or created new mailboxes on.

The error message contains details that describe both the root cause (mailboxes that still exist on the database) and the solution (removing the mailboxes). Let’s take a look at each of the mailbox types and the required actions to move or remove them.

Mailbox Users

Normal mailbox users can be moved to another database. To move the mailboxes issue a New-MoveRequest command and wait for the moves to complete.

For example, to move the mailboxes from “Mailbox Database 2″ to “Mailbox Database 1″ the following command is used.

[PS] C:\>Get-Mailbox -Database "Mailbox Database 2" | New-MoveRequest -TargetDatabase "Mailbox Database 1"

Archive Mailboxes

The cmdlet provided in the error message does not actually help you identify archive mailboxes located on the database in question. For example if I am trying to remove “Mailbox Database 2″, the error message tells me:

To get a list of archive mailboxes in this database, run the command Get-Mailbox -Database DatabaseID -Archive.

However, running that command shows me no results.

[PS] C:\>Get-Mailbox -Database "Mailbox Database 2" -Archive

Instead I can run this command to identify mailboxes with the ArchiveDatabase attribute matching the database that I’m trying to remove.

[PS] C:\>Get-Mailbox | Where ArchiveDatabase -eq "Mailbox Database 2"

Name                      Alias                ServerName       ProhibitSendQuota
----                      -----                ----------       -----------------
Ana.Williams              Ana.Williams         e15mb1           Unlimited
Dawn.Evans                Dawn.Evans           e15mb1           Unlimited
Chris Brown               chris.brown          e15mb1           Unlimited

To move those archive mailboxes I can issue the New-MoveRequest cmdlet again.

[PS] C:\>Get-Mailbox | Where ArchiveDatabase -eq "Mailbox Database 2 | New-MoveRequest -ArchiveOnly -ArchiveTargetDatabase "Mailbox Database 1"

Arbitration Mailboxes

Arbitration mailboxes serve a variety of purposes in Exchange Server 2013, but the important thing at the moment is that they will prevent removal of the database on which they reside.

To view the arbitration mailboxes for a database append the -Arbitration switch to the Get-Mailbox command.

[PS] C:\>Get-Mailbox -Database "Mailbox Database 2" -Arbitration

Name                      Alias                ServerName       ProhibitSendQuota
----                      -----                ----------       -----------------
SystemMailbox{1f05a927... SystemMailbox{1f0... e15mb2           Unlimited
SystemMailbox{bb558c35... SystemMailbox{bb5... e15mb2           Unlimited
SystemMailbox{e0dc1c29... SystemMailbox{e0d... e15mb2           Unlimited
Migration.8f3e7716-201... Migration.8f3e771... e15mb2           300 MB (314,572,800 bytes)
FederatedEmail.4c1f4d8... FederatedEmail.4c... e15mb2           1 MB (1,048,576 bytes)

Arbitration mailboxes can be moved to another database like any other mailbox move request.

[PS] C:\>Get-Mailbox -Database "Mailbox Database 2" -Arbitration | New-MoveRequest -TargetDatabase "Mailbox Database 1"

Public Folder Mailboxes

In Exchange Server 2013 public folder data is stored in special “public folder mailboxes” that can reside within the same databases as regular mailboxes. To check a database for public folder mailboxes run the following command.

[PS] C:\>get-mailbox -Database "Mailbox Database 2" -PublicFolder

Name                      Alias                ServerName       ProhibitSendQuota
----                      -----                ----------       -----------------
Public Folder Test        PublicFolderTest     e15mb2           Unlimited

Public folder mailboxes can be moved the same as other mailboxes.

[PS] C:\>Get-Mailbox -Database "Mailbox Database 2" -PublicFolder | New-MoveRequest -TargetDatabase "Mailbox Database 1"

Mailbox Plans

Mailbox plans are not relevant for on-premise installations of Exchange Server 2013 so you can disregard these.

Completing the Removal of an Exchange 2013 Database

When all of the above mailbox types have been removed from a database you can proceed with the removal of the database itself.

In the Exchange Admin Center navigate to Servers -> Databases, highlight the database you wish to remove and then click on the trash icon.

If you were successful in identifying and removing all of the mailboxes from the database then the database removal should complete successfully.

About Paul Cunningham

Paul is a Microsoft Exchange Server MVP and publisher of Exchange Server Pro. He also holds several Microsoft certifications including for Exchange Server 2007, 2010 and 2013. Connect with Paul on Twitter and Google+.

Comments

  1. Vivek Sharma says:

    I had faced this on Exchange 2010 as well while trying to delete the default mailbox databases created when you install the MBX role. Had to move all the obstructing mailboxes through EMS before it would allow a delete.

  2. Great Article! Thanks for write it :-)

  3. kamal@sandarusi.com says:

    GAH!
    I need to read more and be less impulsive.
    So after 2010SP3 came out I though I was free and clear to install 2013 in my 2010 environment.

    NOOOO! 2013 doesn’t work right, (but it installed normally!) It worked for a little while. After further reading, I realized I was supposed to wait for 2013CU1. grrrrr.

    SO now I want to remove it, but I get the arbitration mailbox problem. Trouble is, they won’t move to the 2010 database, so I am stuck.

    Q: Would it be safe to disable the arbitration mailboxes in the 2013 installation, so I can remove it?
    or
    Q: should I just wait until CU1 comes out, and try to upgrade the 2013 to 2013cu1?

    Thanks.

Leave a Comment

*

We are an Authorized DigiCert™ SSL Partner.
Loading...

Still running Exchange 2003? Time to get moving and start your upgrade. Find out how - Click Here