Office 365: Export All User Mailbox Sizes – Powershell

(Last Updated On: 2021-08-31)

There are various reasons for knowing a Users mailbox size. For my purposes, I needed to plan a Migration from one Office365 Tenant to a New Office365 Tenant. Instead of purchasing a Tool to do the Migration, we opted to simply duplicate the licenses and do a Drop and Drag. When looking at the Mailbox size we do have to remember there are two mailboxes that we must check per user. The actual mailbox and Archive Mailbox.

Start off connect to Office365 Exchange Online. Once connected there are two primary cmd-lets we are going to use.

First is the Get-mailbox this will get you a list of all mailboxes on the connected Exchange, Note this will include active and inactive mailboxes.

The second is Get-mailboxstatistics this will return information specific to the mail requested.

Get Mailbox Size

The command then reads as follows:

Get-Mailbox | Get-MailboxStatistics | Select displayname, totalitemsize 

To Export simply add the Export tags and set a location where to drop the CSV file.

Get-Mailbox | Get-MailboxStatistics | Select displayname, totalitemsize | Export-Csv C:\Temp\CompanyMaiboxSize.CSV -NoTypeInformation

Get Archive Size

The Command reads very similarly to getting the Mailbox size with the mail difference bain the -Archive Tag, this will only return mailboxes with Archive Enabled attribute.

Get-Mailbox -Archive | Get-MailboxStatistics | Select displayname, totalitemsize | Export-Csv C:\Temp\CompanyMaiboxSize.CSV -NoTypeInformation

********************************************************

If you liked what you read Please Share.
I’d love it if you followed me on YouTube and Facebook.

Also, feel free to subscribe to my posts by email.
Donations for the site can be made here.

Thanks for reading.
Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *