Exchange Online Total Size and Items Count

There will come a time when you have to determine the total size of your Microsoft Exchange Online mailbox, or an individual mailbox’s size? Sometimes you will want to know the Item counts per mailbox, or the counts for the all the mailboxes. Is there an easy way to do this? Well, read on …

As this is the first blog post of 2019, let me wish everyone a Happy New Year.

Back to our MS Exchange Online size and item count discussion; in this blog post, I will show you the easy way to determine the size and item counts per mailbox of your MS Exchange Online (MS Office 365) using PowerShell. Let’s get started:

Connect to Office 365

Before you start working with the Powershell commands, you must connect to the MS Exchange Online Powershell using the following commands:

$office365Credential = Get-Credential
$global:office365= New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $office365Credential -Authentication Basic –AllowRedirection
Import-PSSession $office365

Using those commands, you can login to your subscription using your username and password.

Note: Be sure to disconnect the remote PowerShell session when you’re finished. If you close the Windows PowerShell window without disconnecting the session, you could use up all the remote PowerShell sessions available to you, and then you’ll have to wait for the sessions to expire. To disconnect the remote PowerShell session, run the following command:

Remove-PSSession $Session


MailBox Size and Items Count

To get the information you will need, mailbox size and Items count, we will use the Get-Mailbox command to specify the desired output:

get-mailbox | get-mailboxstatistics | ft displayname, totalitemsize, ItemCount


The output from that command will be the Mailbox display name, Total Item Size, and the Total Item Count, as follows:

In the case where you have many mailboxes, and you want to export the output to MS Excel to make it easier for working with the data, you can use the following command:

Get-Mailbox -ResultSize unlimited | Get-MailboxStatistics | Select DisplayName,TotalItemSize, ItemCount | Sort-Object -Property TotalItemSize -Descending | export-csv -path C:\temp\sizes.csv

With that command, the output will be enclosed within a single MS Excel file.

Summary

On this blog post I showed you the easy way to help customers and partners to size their MS Exchange Online backups. This basic blog post must be your starting point to get more info from the MS Office 365 environment, like getting the size of the SharePoint and OneDrive data stores. If you want an even easier way of getting this information, and to generate reports, I recommend trying an excellent tool called: AdminDroid: https://admindroid.com/ (15 days trial). Till next time…

One thought on “Exchange Online Total Size and Items Count

Leave a Reply