TheGeekery

The Usual Tech Ramblings

Unable to remove Exchange Mailbox Database

We had an odd issue recently where our Exchange server refused to let us remove a mailbox database, citing that the database had one or more mailboxes. The exact error was this:

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

Okay, so thinking we were being stupid and missed the arbitration mailboxes, we ran the recommended commands, with no such luck:

[PS] D:\>get-mailbox -database 'Mailbox Database 2102391437' -Arbitration
[PS] D:\>

The same was true of mailbox plans, and archive mailboxes. After some head scratching, I stumbled across this post on TechNet. The basic gist is that because Exchange is in a multi-domain forest, the get-mailbox command will usually only search in the domain you are active in. To make Exchange operate outside of the working domain, you have to set the server settings.

[PS] D:\>set-adserversettings -ViewEntireForest $true
[PS] D:\>get-mailbox -database 'Mailbox Database 2102391437'
[PS] D:\>get-mailbox -database 'Mailbox Database 2102391437' -Arbitration

Name                      Alias                ServerName       ProhibitSendQuota
----                      -----                ----------       -----------------
SystemMailbox{bb558c35... SystemMailbox{bb5... msg014a          Unlimited
Migration.8f3e7716-201... Migration.8f3e771... msg014a          300 MB (314,572,800 bytes)

Sure enough, those system mailboxes hiding out in the mailbox database. Now we can see them, we can move the mailboxes off of the database, and then remove the database.

Comments