Checking if a mailbox has been disconnected or deleted

Get-MailboxDatabase | foreach {Get-MailboxStatistics -Database $_.name} | where {$_.DisplayName -eq “<display name>”} | Format-List DisplayName,Database,DisconnectReason

$dbs = Get-MailboxDatabase

$dbs | foreach {Get-MailboxStatistics -Database $_.DistinguishedName} | where {$_.DisconnectReason -eq “Disabled”} | Format-Table DisplayName,Database,DisconnectDate

$dbs | foreach {Get-MailboxStatistics -Database $_.DistinguishedName} | where {$_.DisconnectReason -eq “SoftDeleted”} | Format-Table DisplayName,Database,DisconnectDate

Leave a Reply