How to get Exchange Active Mailboxes
Let’s looks at how you can get a list of Exchange Active Mailboxes using the Exchange Shell.
The following cmdlet can be used.
The following script with run through all the mailboxes in the Exchange Organization and provide a list of Active Mailboxes, however this is not a refined search and the list can be long.
1 |
Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox,SharedMailbox | Get-MailboxStatistics | Sort-Object lastlogontime -Descending | Select DisplayName,LastLogonTime,ItemCount |
With the following you can refine the search to give results based on the last 30 days.
1 |
Get-Mailbox -ResultSize Unlimited –RecipientTypeDetails UserMailbox,SharedMailbox | Where {(Get-MailboxStatistics $_.Identity).LastLogonTime -gt (Get-Date).AddDays(-30)} | Sort -Property @{e={( Get-MailboxStatistics $_.Identity).LastLogonTime}} -Descending | Select-Object DisplayName,@{n="LastLogonTime";e={(Get-MailboxStatistics $_.Identity).LastLogonTime}} |
#ThatLazyAdmin
Be First to Comment