Exchange 2010 – Locating Disconnected Mailboxes
Here is a quick Powershell function to make finding disconnected mailboxes easier.
Save this as Get-DisconnectedMailbox.ps1:
function Get-DisconnectedMailbox { [CmdletBinding()] param( [Parameter(Position=0, Mandatory=$false)] [System.String] $Name = '*' ) $mailboxes = Get-MailboxServer $mailboxes | %{ $disconn = Get-Mailboxstatistics -Server $_.name | ?{ $_.DisconnectDate -ne $null } $disconn | ?{$_.displayname -like $Name} | Select DisplayName, @{n="StoreMailboxIdentity";e={$_.MailboxGuid}}, Database } }
Open the Powershell console, and dot source the function, assuming PS1 is stored in c:\scripts
cd c:\scripts . .\Get-DisconnectedMailbox.ps1 Get-DisconnectedMailbox mailserver1.contoso.com