Quantcast
Channel: Exchange Server 2013 - General Discussion forum
Viewing all articles
Browse latest Browse all 4521

Get-MailboxStatistics cmdlet changes between Exchange 2010 and Exchange 2013

$
0
0

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


Viewing all articles
Browse latest Browse all 4521

Trending Articles