Error: This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, or arbitration mailboxes

Have you already tried removing an Exchange 2010 Server from your environment? If yes then you must have faced this error at least once. If you are removing an Exchange 2010 server from your environment then then you must also remove the databases hosted on that server where user mailboxes are. In case you have mailboxes then exchange will not allow you performing uninstall of the server.

While we remove an Exchange Server from environment we do need to clean up the mailboxes from all databases on that server ( This applies to legacy and Exchange 2010 Servers too). But most of the times when you run the cmdlet Remove-MailboxDatabase,  you would face an error like:

 

Error:
This mailboxdatabase contains one or more mailboxes or arbitration 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 arbitration mailboxes in this database, run the command Get-Mailbox – Database <Database ID> – Arbitration, Before you can remove this mailbox database, you must disable, move, or remove user mailboxes and move arbitration mailboxes.

Exchange 2010 makes it little tricky to remove all mailboxes because of some hidden mailboxes which are not visible in EMC and EMS unless a special switch is passed to Get-Mailbox cmdlet.

If you haven’t heard of this thing before then the question on your mind is absolutely correct. What are these mailboxes and why do exchange 2010 need them?

Exchange 2010 introduces a new feature called moderated transport and Exchange Server 2010 uses these mailboxes for managing moderated transport. I wrote a blog post about moderated emails in Exchange 2010 last year. This post will help you understanding what is the moderated transport with an example. Read it here Configuring Message Moderation for Email Delivery to DLs in Exchange 2010 . The linked document is just an example of the things that moderated transport can do for you. To see these mailboxes use Get-Mailbox –Database DB001 –Arbitration.

Coming back to the original topic of removing these mailboxes used for moderated transport here is how we remove them:

  1. First make sure that you have moved / removed all your mailboxes to some other database and no results are returned when you run Get-Mailbox – Database DB001
  2. Then run Get-Mailbox –Database DB001 –Arbitration | Remove-Mailbox –RemoveLastArbitrationMailboxAllowed:$True
  3. This command will remove all arbitration mailboxes and then you can remove your databases using Remove-MailboxDatabase  -Identity DB001 -RemoveLastArbitrationMailboxAllowed:$True
  4. Confirm your action when EMS asks you to do so and you are done

 

 

.