Delete Disconnected Mailbox from Exchange 2007

To do this you must open up the Exchange Management Shell on Exchange 2007.  Then at the prompt you will want to find the GUID for the mailbox you wish to delete.  You can do this by typing the following command:

Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid

You should then see a prompt like this.

To remove individual mailboxes use the  following command with your servers info replaced in bold:
Remove-Mailbox -Database “Database-Name” -StoreMailboxIdentity MailboxGuid -confirm:$false

After this runs check to see if the GUID is gone by running the “Get-MailboxStatistics” command again.  After this has been run the mailbox has been removed from the system.

To remove all disconnected mailboxes use the following commands, please note replace “Mailbox Store” with your information.

This command will query the current disconnected mailboxes.
$users = Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid

This command will use the query to remove the mailboxes.
$users | ForEach { Remove-Mailbox -Database “Mailbox Store” -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }

– Harry Caskey

One Reply to “Delete Disconnected Mailbox from Exchange 2007”

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.