https://o365reports.com/2020/10/21/export-office-365-mailbox-size-report-using-powershell/
As an admin, it is an important task to periodically monitor Office 365 mailbox size and quotas. Else, it will end up in error like ‘mailbox size limit exceeded,’ ‘unable to send/receive messages due to mailbox quota,’ etc.
So, how will you check the mailbox size in Office 365? You can use either the Exchange admin center or PowerShell to get a mailbox usage report. But the Exchange admin center can show limited information only. With PowerShell, you can get a detailed mailbox size report. However, you need to combine multiple cmdlets like Get-Mailbox, Get-MailboxStatistics, etc.
To ease your work, we have created a handy PowerShell script to export mailbox size and quotas to a nicely formatted CSV file.
The exported mailbox size usage report looks like screenshot below:
The exported mailbox size and quota report contains following attributes: