I often need to get statistics and check mailbox sizes and quotas and here are some useful notes and examples that I often cut’n’paste instead of re-inventing them:
Get top list of big mailboxes, sorted by size:
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,StorageLimitStatus,TotalItemSize -First 100 | Sort-Object TotalItemSize
Find those who have reached their quota already:
Get-Mailbox -Resultsize Unlimited | Get-MailboxStatistics | where {$_.StorageLimitStatus -eq “IssueWarning”}
Get-Mailbox -Resultsize Unlimited | Get-MailboxStatistics | where {$_.StorageLimitStatus -eq “ProhibitSend”}
Or combine them both:
Get-Mailbox -Resultsize Unlimited | Get-MailboxStatistics | where {($_.StorageLimitStatus -contains “ProhibitSend”) –or ($_.StorageLimitStatus -contains “IssueWarning”)}
Set new quota to issue warning at 8 GB and issue send at 8.5 GB.
Set-Mailbox <mailbox> -UseDatabaseQuotaDefaults $false -IssueWarningQuota 8GB -ProhibitSendQuota 8.5GB
You might have seen that even though you change the quota, the change does not take place immediately. See this article for more information.
To get some information on the size of the Archive mailboxes:
Get-Mailbox | Get-MailboxStatistics -Archive -ErrorAction SilentlyContinue | ft DisplayName,TotalItemSize
Let me know if you need some more examples and I’ll keep adding them.
Hi I am looking for script which help to fetch the data of shared mailbox who have and what kind of access on shared mailbox even shared mailbox name.
Get-MailboxPermission | where {!$_.isinherited }
This will return all permissions that are not inherited, so have been applied to the mailbox after creation
This no longer works in Exchange 2013 and above.
You have to use like
“Get-MailboxFolderStatistics “Eleanor Doty”| Sort-Object FolderSize | FT Name, folderpath,FolderSize,ItemsinFolder -AutoSize”
And compare the fields.