O'Reilly logo

Microsoft Exchange Server PowerShell Cookbook - Third Edition by Mike Pfeiffer, Jonas Andersson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reporting on the mailbox size

Using cmdlets from both the Exchange Management Shell and Windows PowerShell gives us the ability to generate detailed reports. In this recipe, we will use these cmdlets to report on all of the mailboxes within an organization and their total size.

How to do it...

Let's see how to generate and export the report of a mailbox using the following steps:

  1. Use the following command to generate a report of each mailbox in the organization and the total mailbox size:
    Get-MailboxDatabase | Get-MailboxStatistics | 
    ?{!$_.DisconnectDate} | 
    Select-Object DisplayName,TotalItemSize
    
  2. Pipe the command even further to export the report to a CSV file that can be opened and formatted in Excel:
    Get-MailboxDatabase | Get-MailboxStatistics ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required