Office 365 – Report on Shared Mailboxes

A quick one-liner, which pulls back a list of shared mailboxes, last logon time, size in MB and item count.

Connect to your EXO with connect-exchangeonline then run the below (This can take a while of you have a large amount of shared mailboxes)

Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize:Unlimited | get-mailboxstatistics | select displayname,lastlogon*,@{name=”TotalItemSize (MB)”; expression={[math]::Round(($_.TotalItemSize.ToString().Split(“(“)[1].Split(” “)[0].Replace(“,”,””)/1MB),2)}},ItemCount | Sort “TotalItemSize (MB)” -Descending | Export-CSV “C:\temp\All Mailboxes.csv” -NoTypeInformation


Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.