Do you use 365? Ever needed a quick list of all your users and their mailbox size? What about having it nicely formatted? Or do you only want to see a certain size mailbox? This quick one-liner is a good starting point.
Get-EXOMailbox -ResultSize Unlimited | Get-EXOMailboxStatistics | Select DisplayName, ItemCount, TotalItemSize | Sort-Object TotalItemSize -Descending | Export-Excel -Path C:\scripts\MailboxSizes.xlsx -AutoSize
What this does is uses the current way to get a 365 mailbox(Get-mailbox is deprecated), grabs all the mailboxes, selects only the Display name, amount of emails, and total size of their mailbox. It will then put the largest mailbox at the top and smallest at the bottom. After all of that, it exports it to an excel file that you can manipulate how you like. If you haven’t already used Doug Finke’s ImportExcel module, I’d recommend it to get creative with your formatting without ever opening Excel to format. You could add it so all mailboxes over a certain size are a certain color.
Hope this helps let me know if you expand on this even if its not a one liner, I’d love to see!
Drew McClellan says
Nice!
ClaytonT says
Thanks Drew!