How to remove the default database in Exchange 2013


When you install a new Exchange server you may want to remove the default database because of different reasons. Even if you moved the mailboxes visible in ECP this error message will probably show up when you try to delete it: “This mailbox database contains one or more mailboxes, mailbox plans, archive mailboxes, public folder mailboxes or arbitration mailboxes, Audit mailboxes.” I will go through how to solve this and remove the default mailbox database in Exchange 2013.

This is the error message you will encounter when trying to delete the database.

Exchange 2013: This mailbox database contains one or more mailboxes

Start by moving all the mailboxes to the new database. This command will move all (almost – more on that later) mailboxes to the database of your choice.

Get-Mailbox –Database “Source database name” | New-MoveRequest –TargetDatabase “New database name”

Tip: Use the parameter –WhatIf to run the command without actually running it. Perfect to discover errors in commands.

Move mailboxes in Exchange 2013Now you can see all mailboxes that’s going to be moved. And they are queued which is specified under Status Detail. To see if the move is finished runt this command: Get-MoveRequest

We’re not ready to remove the database yet. There are still some hidden mailboxes left in the database. The Arbitration mailboxes are created by default when you add the first Exchange server to your organization.

To see those mailboxes you must use the –Arbitration parameter. Enter the command Get-Mailbox –Arbitration to see them.

To move them we need to pipe this command to New-MoveRequest. It will look like this:

Get-Mailbox -Arbitration | New-MoveRequest -TargetDatabase “NewMailDB”

Move Arbitration mailboxes in Exchange 2013

They are now queued, and to check the status run the command Get-MoveRequest again. Wait until all of them are completed.

You can now go back to the Exchange admin center and remove the default database. It will throw a warning telling you to remove the database files from disk as well.

Remove default mailbox in Exchange 2013

And you’re done!