Wednesday, December 17, 2014

Fix ‘This mailbox database contains one or more mailboxes’ Error in Exchange 2013

Several times when you attempt to remove a database from an MS Exchange Server 2013 mailbox, you may come across the following error:

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

You may note here this error occurs even on a brand new mailbox database which you have not migrated any mailboxes to or created new mailboxes on is susceptible to this type of error. 

Below is the snapshot of this error:

This error message provides the following details: 

      a)    Root cause- It is due to the mailboxes that still exist on the database.
      b)    Resolution - It is achieved by removing the mailboxes.

Now, let’s take a glance at each of the mailboxes types and the required strategy to move or remove them.

     a) MAILBOX USERS – For normal mailbox users, you need to runthe following command New- MoveRequest and wait for the moves to complete. In this way mailbox users can be moved to another database.

E.g.To move the mailboxes from ‘Mailbox Database A’ to ‘Mailbox Database B’ the following command is executed.

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

       b)   ARCHIVE MAILBOXES – In these type of mailboxes, the default command provided(for removal) in the error message does not actually work. So instead of this, you can run the following command to identify mailboxes with the ArchiveDatabase attribute matching the database that you are trying to remove.

[PS] C:\>Get-Mailbox | Where ArchiveDatabase -eq "Mailbox Database P"
Name                  Alias                 ServerName            ProhibitSendQuota
 ----                     ----                    ----------                   --------------
Mark.Luther       Mark.Luther        e15mb1                      Unlimited
Denis.Lilly           Denis.Lilly           e15mb1                      Unlimited

To move these archive mailboxes, you need to execute the following New- MoveRequest command again.
[PS] C:\>Get-Mailbox | Where ArchiveDatabase -eq "Mailbox Database P | New-MoveRequest -ArchiveOnly -ArchiveTargetDatabase "Mailbox Database Q"

       c)  ARBITRATION MAILBOXES – In Exchange Server 2013, this type of mailboxes serve many purposes but generally they prevent the removal of the database on which they exist in.

To view the arbitration mailboxes execute the Get-Mailbox command as follows:

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

Now, arbitration mailboxes can be moved to another database similar to any other mailbox move request.

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

4    d)  PUBLIC FOLDER MAILBOXES - There is a special folder named ‘public folder mailboxes’ in    Exchange Server 2013 where public folder data is stored.

To check a database for public folder mailboxes run the following command:
[PS] C:\>get-mailbox -Database "Mailbox Database P" –PublicFolder

Now these public folders can be moved by executing the following command:
[PS] C:\>Get-Mailbox -Database "Mailbox Database P" -PublicFolder | New-MoveRequest -TargetDatabase "Mailbox Database Q"

FINALLY REMOVING THE EXCHANGE SERVER 2013 DATABASE – After the removal of all mailboxes types from the database, you can finally proceed to remove the database itself.
Now navigate to Exchange Admin Center (EMC)-> Servers ->Databases, select the database which you want to delete, and click the trash icon.

So make sure that you have carefully identified and removed all the mailboxes because this will ensure the successful removal of Exchange 2013 database. 

No comments:

Post a Comment