Exchange 2010: Remove Disconnected Mailbox

QuickTip

In Exchange, every Mailbox consists of a combination of:

  • Active Directory User:
  • Mailbox Data stored in the Exchange mailbox database

All configuration data for a mailbox is stored in the Exchange attributes of the Active Directory user object and mail data is stored in the Mailbox Database.

When a Mailbox is disabled in Exchange, the Mailbox Data stored in the Exchange mailbox database is no longer associated Active Directory User Account, which results in it becoming a Disconnected Mailbox.

View Disconnected Mailbox

If after disabling the Mailbox it is not visible in both EMS or EMC, then run the following command in EMS: Get-MailboxDatabase | Clean-MailboxDatabase

In EMC:

EMC > Exchange Organization > Recipient Configuration > Disconnect Mailboxes

In EMS:

Get-MailboxStatistics -Database “Mailbox Database 1181764618” | Where-Object {$_.DisconnectDate -Notlike $NULL} | FL DisplayName, DisconnectDate, MailboxGuid

Remove Disconnected Mailbox:

Copy the MailboxGuid from the Output from the above command for the Mailbox you want to remove and use it as follows:

Remove-Mailbox -Database “Mailbox Database 1181764618” -StoreMailboxIdentity 8981ab0c-2616-469f-a1c3-7cfc684c9b28

Remove Multiple Disconnected Mailboxes from a Database:

In case you have multiple disconnected mailboxes for a database and want to remove all, then use to command as follows:

$AllMBX = Get-MailboxStatistics -Database “Mailbox Database 1181764618” | Where-Object {$_.DisconnectDate -ne $NULL} | Select MailboxGuid, Database

$AllMBX| ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }