February 9, 2015

Office 365 - MailboxStatistics TotalItemSize

In Exchange on premise we could easily convert output of TotalItemSize value to Mb expression using Value.ToMb() method. Another story happened in Office 365. Following example shows us how to get statistics of all Office 365 shared mailboxes:

Get-mailbox | where {$_.RecipientTypeDetails -like "SharedMailbox"} | Get-MailboxStatistics | Select DisplayName,@{name="TotalItemSize (MB)";expression={[math]::Round(($_.TotalItemSize.ToString().Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},@{name="TotalDeletedItemSize (MB)";expression={[math]::Round(($_.TotalDeletedItemSize.ToString().Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},ItemCount,DeletedItemCount

This output shows all shared mailboxes including information about deleted items. 

No comments:

Post a Comment