Removing disconnected mailboxes in Exchange Server 2007

Removing disconnected mailboxes in Exchange Server 2007
Exchange Server 2007 doesn’t allow you to purge the disconnected mailbox and in order to remove single or multiple disconnected mailboxes you can do following:
Get all disconnected mailboxes
Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid
Remove a single disconnected mailbox
Remove-Mailbox -Database <Database-Name> -StoreMailboxIdentity <MailboxGuid> -confirm:$false
Remove all disconnected mailboxes
$users = Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid,Database
Now, all disconnected mailboxes are in a variable and you need to run following cmdlet toremove all of them:
$users | ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }
Categories: Exchange 2007Bookmark

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>