How to quickly clean mailbox in Exchange 2010/2013

I had troubles and a lot of mess in my test mailbox and didn´t have time to cleanup, so here is, what I did. Basically I used a method, which is also used, when there are problems in production and server / database goes down and you must use Dial tone restore.

  • Gather mailbox database
Get-Mailbox <identity> | select MailboxDatabase
  • Rehome mailbox (set different database to mailbox)
Get-Mailbox <identity> | Set-Mailbox -Database <DB identity>
Get-mailbox x9xxxx | Set-Mailbox -Database MDB12
Confirm Rehoming mailbox "domain.local/Persons/Administrators/test/CZ/X9XXX" to database "MDB12". This operation will only modify the mailbox's Active Directory configuration. Be aware that the current mailbox content will become inaccessible to the user. [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "Y"):

Use Clean-MailboxDatabase on old database to see the mailbox in disconnected mailboxes.

Get-MailboxDatabase <old MDB identity> | Clean-MailboxDatabase
  • Your old data will be removed according your Exchange configuration or you can force deletion by command Remove-StoreMailbox <your old data mailbox identity> as well described here:

  • Your mailbox is clean.