Exchange 2007 Remove Disconnected Mailboxes

If you delete a user on Exchange 2007, it will delete the user in Active Directory. It will not, however, delete the mailbox that was associated with the user. This mailbox will then move onto bigger and better things – namely just taking up storage space on your Exchange server.

Quick and easy way:
On your Exchange server, open up the Exchange Management Shell
Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid – This will show all the disconnected mailboxes AND their associated MailboxGuid (which is needed to delete the boxes)
Remove-Mailbox -Database [Database-Name] -StoreMailboxIdentity [MailboxGuid] – This will delete a single line item.

EDIT 11.13.2008:
You can run the Get-MailboxDatabase command to find out the name of the database and what server it resides on. The final delete command will be something like the following:
Remove-Mailbox -Database "servername\mailbox database" -StoreMailboxIdentity 2ae3c6f1-848e-4892-923c-614f9b3838f7
Then it will ask if you want to really remove the GUID from the database.

Leave a Reply

Your email address will not be published. Required fields are marked *