How to Remove A Mailbox in Exchange 2010 With One or More Mailboxes Error

If you're encountering the following error even after you have removed all the user account mailboxes , then you need to follow the solution steps below. Please note that the solution below is not for removing the last database on your Exchange 2010.

Error:

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


Solutions:

  1. Launch Exchange Management Shell
  2. Check for user account mailbox Archive with this command,
 Get-Mailbox | where {$_.ArchiveDatabase -eq "Your Database"}

if there is any user account is still using the intended database to be removed with Archive enabled, then you need to move it to another database first.

Once you determined there are no more user mailboxes using the the database to be removed then follow these next steps.

  1. Check for Soft Deleted mailboxes by running this command
 Get-mailboxstatistics -database "Your Database" |fl

This will list all the mailboxes that are disconnected from the database and labeled as SoftDeleted. If it shows a list of the mailboxes in SoftDeleted then run the next command, otherwise you can skip it.

      2. To permanently delete all SoftDeleted mailboxes, run this command

Get-MailboxStatistics -Database "Your Database" | where {$_.DisconnectReason -eq "SoftDeleted"} | foreach {Remove-StoreMailbox -Database $_.database -Identity $_.mailboxguid -MailboxState SoftDeleted}

Unfortunately, you will have to acknowledge each of the mailboxes to be permanently deleted from the database. Once all the SoftDeleted mailboxes are confirmed, you need to follow the next step.

      3. Check for mailbox Arbitration with this command


Get-Mailbox -Database 'Your Database'-Arbitration

It should list the Arbitration mailboxes that contributed to the initial error. You will need to move them to another database with these next steps.

     4. Set-AdServerSettings -ViewEntireForest $True

     5. Get-mailbox –Arbitration –Database "Your Database"| new-MoveRequest –targetdatabase "Your Other Database"

     6. Get-moverequest

It will display whether the move request has been completed.

    7. Get-moverequest | Remove-moverequest

    8. Remove-mailboxdatabase –identity "Your Databse"