Wednesday, July 11, 2012

Exchange 2007 Purge All Disconnected Mailboxes - Cmdlet

First

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

Then

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

No comments:

Post a Comment