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.
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