Optimizing your Office 365 workspace often involves keeping track of mailbox sizes, especially in larger organizations. Exporting mailbox sizes to a CSV format allows for easier monitoring, analysis, and troubleshooting. Here, you'll learn how to achieve this, ensuring a seamless, productive, and organized Outlook experience.

Before we dive in, ensure you're using Exchange Online and have the appropriate permissions. Additionally, you'll need to use PowerShell's `Get-MailboxStatistics` cmdlet, which retrieves mailbox statistics, including size information.

Preparations for Export
Navigating to your Office 365 portal, proceed to the Exchange Admin Center. Here, you'll begin your PowerShell journey to export mailbox sizes.

Before executing any commands, ensure your PowerShell session is in the correct mode: connect to Exchange Online using the `Connect-ExchangeOnline` cmdlet, and import the Exchange Online PowerShell snapshot using `Import-Module -Name ExchangeOnlineManagement`.
Identifying Mailboxes

First, let's find all the mailboxes in the organization using the `Get-Mailbox` cmdlet:
``` Get-Mailbox -ResultSize Unlimited | Select-Object Name,RecipientTypeDetails ```
This query returns a list of mailboxes along with their recipient types.
Filtering Results

You might need to filter your results based on specific criteria. For instance, to retrieve only enabled mailboxes, use:
``` Get-Mailbox -ResultSize Unlimited | Where-Object {$_.IsEnabled -eq $true} | Select-Object Name,RecipientTypeDetails ```
Extracting Mailbox Sizes
Once you've identified the mailboxes, proceed to gather their size information.
![Microsoft Outlook Contacting the Server for Information [Fixed]](https://i.pinimg.com/originals/0c/66/6a/0c666abca79bedfe8f948e19bd25acf7.jpg)
Utilize the `Get-MailboxStatistics` cmdlet and pipe the output to export to a CSV file:
``` Get-MailboxStatistics | Select-Object DisplayName,TotalItemSize, ItemCount | Export-Csv -Path "C:\ExchangeMailboxes.csv" -NoTypeInformation ```
The CSV File: columns and sizes






The resulting CSV file, located in your specified path, will contain three columns: 'DisplayName', 'TotalItemSize', and 'ItemCount'. The 'TotalItemSize' represents the total size of all items in the mailbox, including attachments, in bytes.
For instance, if the size is large (say, 10GB), the value in the 'TotalItemSize' column will be approximately 10737418240 bytes, as 1 GB = 1073741824 bytes.
Cleaning Up
Once finished, disconnect your PowerShell session from Exchange Online with the `Disconnect-ExchangeOnline` cmdlet.
There you have it! You've successfully exported your Office 365 mailbox sizes to a CSV file, empowering you to manage your mailboxes more efficiently.
Regularly checking and monitoring these mailbox sizes keeps data usage in check, preventing any potential storage issues. Happy administering!