Have you ever wanted to get all disconnected mailboxes from Exchange?
Here is a “short” PowerShell syntax, for exactly that:
|
1 |
Get-ExchangeServer | Where-Object {$_.IsMailboxServer -eq $true} | ForEach-Object { Get-MailboxStatistics -warningAction silentlyContinue -Server $_.Name | Where-Object {$_.DisconnectDate -ne $null}} |
It checks only the mailbox servers in your Exchange farm, and finds the disconnected/disabled mailboxes.