Get list of dormant mailboxes using Powershell
October 24, 2009 Leave a comment
A quick Powershell command that returns a list of all the mailboxes on your Exchange server not accessed in 90 days
Get-MailboxStatistics | where {$_.Lastlogontime -lt (get-date).AddDays(-90)}| Select displayName,LastLoggedOnUserAccount,LastLogonTime
You could also write the results to a csv using the Export-CSV cmdlet :-
Get-MailboxStatistics | where {$_.Lastlogontime -lt (get-date).AddDays(-90)}| Select displayName,LastLoggedOnUserAccount,LastLogonTime | Export-CSV c:\NoLogon30Days.csv