Get-MailboxStatistics cmdlet changes between Exchange 2010 and Exchange 2013

Hi...

First of all, I am definitely not an expert in PowerShell, nor Exchange...

Based on bits an pieces I grabbed here and there on the Internet, I managed to create 2 distinct (but somewhat similar) powershell scripts to report on:

  • the size of each Mailbox Store found on a given server
  • the size of each Mailbox found on a given server

I am using the following cmdlets to pull the data I need:

Mailbox Store Size:

Get-MailboxStatistics -Server $MachineName `
  | where {$_.ObjectClass eq Mailbox} `
  | Sort-Object Database `
  | Select-Object @{Name="Mailbox Store";expression={$_.Database}}, `
                  @{Name="Size (GB)";expression={$_.TotalItemSize.Value.ToGB()}} `
  | ConvertTo-CSV -OutVariable OutData -NoTypeInformation `
  | Select-Object -Skip 1 `
  | Out-File -FilePath $CsvFileToCreate -Encoding "unicode"

Mailbox Size:

Get-MailboxStatistics -Server $MachineName `
  | where {$_.ObjectClass eq Mailbox} `
  | Sort-Object TotalItemSize Descending `
  | Select-Object @{label="Mailbox Store";expression={$_.Database}}, `
                  @{label="User";expression={$_.DisplayName}}, `
                  @{label="Mailbox Size (MB)";expression={$_.TotalItemSize.Value.ToMB()}}, `
                  @{label="Total Items";expression={$_.ItemCount}} `
  | Export-CSV -Path $CsvFileToCreate -Encoding "unicode"

After that, I work with my CSV file to generate an nicely formatted report.

Until now this has worked well with Exchange 2007 and 2010...

But I recently came across 3 Exchange 2013 servers... and on each of these, the CSV produced file remains empty...

Any help will be appreciated.

Thanks

Francis Germain

September 10th, 2015 3:52am

Exchange 2010/2013 - Get-MailboxStatistics to get a list of all mailboxes and their sizes, the following command produces this information: http://clintboessen.blogspot.in/2013/09/exchange-20102013-get-mailboxstatistics.html

List the size of ALL mailboxes in 2013

Exchange 2010 - Get-MailboxStatistics like I want it.
Moreover, You may also take help from this automated solution i.e. ( http://www.reporting.exchangereporter.net/ ) which lets you to accomplish this task without any interruption.

Hope it helps you!

Free Windows Admin Tool Kit Click here and download it now
September 10th, 2015 5:21am

Hi Francis,

Base on my research, the mailbox in exchange 2013, the value of ObjectClass property is "Unknown", not "Mailbox",

So that is reason why you got an empty report, please change the objectclass property and try running again.

Best regards,

September 11th, 2015 3:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics