How to remove disconnected mailboxes in Exchange Server 2007
Uncategorized January 2nd, 2010Get 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 to remove all of them:
$users | ForEach { Remove-Mailbox -Database $_.Database -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }



Recent Comments