Looking for Mailboxes not being used

Did you have a request to find all mailboxes not being used for an extended period of time? For example 180 days? You could look for Users that haven’t logged in in AD using dsquery or maybe adfind. But what if you have mailboxes that are assigned to multiple users and the mailbox owner never logs in? In Exchange 2010 there is an easier way to find such mailboxes. Just use powershell…

get-mailbox -IgnoreDefaultScope | Get-MailboxStatistics |` 
where {$_.lastlogontime -le ((Get-Date).Adddays(-180))} |` 
ft displayname,lastlogontime,totalitemsize -AutoSize

In example above you’ll find all mailboxes not being used for at least 180 days, despite of, which user ever logged in to them.

This post is also available in: German, Polish

Comments are closed.