Tuncay Sahin

ICT Engineer | Docent ICT & Trainer

In earlier versions of Exchange, we could look in the Exchange System Manager and see mailbox sizes on a per database basis. This feature is removed in EMC GUI.

Use the Get-MailboxStatistics cmdlet to obtain information about a mailbox, such as the size of the mailbox, the number of messages it contains, and the last time it was accessed. In addition, you can get the move history or a move report of a completed move request.

Use the Exchange Management PowerShell to view Mailbox statistics

mailbox statistics for the mailbox of the user Ayla Kol by using its associated alias AylaKol.

Get-MailboxStatistics -Identity AylaKol

mailbox statistics for all mailboxes on the server MailboxServer01

Get-MailboxStatistics -Server MailboxServer01

Show all available fields with their values

Get-MailboxStatistics -server MailboxServer01 | fl

Show last logon time by just selecting DisplayName and LastLogonTime fields.

Get-MailboxStatistics -server MailboxServer01 | Select DisplayName, LastLogonTime

mailbox statistics for the specified mailbox

Get-MailboxStatistics -Identity contoso\chris

mailbox statistics for all mailboxes in the specified mailbox database

Get-MailboxStatistics -Database “Mailbox Database”

mailbox statistics for the disconnected mailboxes for all mailbox databases in the organization. The -ne operator means not equal.

Get-MailboxDatabase | Get-MailboxStatistics -Filter ‘DisconnectDate -ne $null’

the summary move history for the completed move request for Ayla Kol’s

Get-MailboxStatistics -Identity AylaKol -IncludeMoveHistory | Format-List

display just specific fields, such as DisplayName, ItemCount, and TotalItemSize

Get-MailboxStatistics [username] | ft DisplayName, TotalItemSize, ItemCount

Selective mailbox statistics for all mailboxes in the specified mailbox database

Get-MailboxStatistics -database “Mailbox Database” | Select DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime | Format-Table

export into CSV

Get-MailboxStatistics -Database “Mailbox Database” | Select DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime | Export-CSV test.csv

Return Mailbox size as MB

Get-MailboxStatistics -Database “Mailbox Database” | Format-Table DisplayName, LastLoggedOnUserAccount, ItemCount, @{expression={$_.totalitemsize.value.ToMB()};label=”Size(MB)”}, LastLogonTime, LastLogoffTime

Filtering results for example to only display objects classified as mailboxes.

Get-MailboxStatistics | where {$_.ObjectClass –eq “Mailbox”}

Sorting Results

Get-MailboxStatistics | Sort-Object TotalItemSize –Descending

Get Quota’s

Get-Mailbox username| fl *quota*

Customizing results for example to convert bytes to MB by replacing the “TotalItemSize” field and adding custom labels.

Get-MailboxStatistics | where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}},@{label=”Items”;expression={$_.ItemCount}},@{label=”Storage Limit”;expression={$_.StorageLimitStatus}} -auto

More examples Get-Mailbox cmdlet:

get-mailbox -ResultSize Unlimited | sort OrganizationalUnit, DisplayName | select Name, DisplayName, PrimarySmtpAddress, Database, UseDatabaseQuotaDefaults, @{Name=’IssueWarningQuota (MB)’; expression= { $_.IssueWarningQuota.value.toMB()}}, @{Name=’ProhibitSendQuota (MB)’; expression= {$_.ProhibitSendQuota.value.toMB()}}, @{Name=’ProhibitSendReceiveQuota (MB)’; expression= { $_.ProhibitSendReceiveQuota.value.toMB()}}, OrganizationalUnit, RecipientTypeDetails, @{Name= ‘TotalItemSize(MB)’; expression={ (Get-MailboxStatistics $_.Name).TotalItemSize.Value.toMB() }}, @{Name=’ItemCount’; expression={ (Get-MailboxStatistics $_.Name).ItemCount}}

Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName, IssueWarningQuota, ProhibitSendQuota, @{label=”TotalItemSize(MB)”;expression={(Get-MailboxStatistics $_).TotalItemSize.Value.ToMB()}}, @{label=”ItemCount”;expression={(Get-MailboxStatistics $_).ItemCount}}, Database | Export-Csv “C:\temp\UserMailboxSizes.csv” -NoTypeInformation

Get-Mailbox -ResultSize Unlimited | Where {$_.UseDatabaseQuotaDefaults -eq $false} | Select-Object DisplayName, IssueWarningQuota, ProhibitSendQuota, @{label=”TotalItemSize(MB)”;expression={(Get-MailboxStatistics $_).TotalItemSize.Value.ToMB()}}, @{label=”ItemCount”;expression={(Get-MailboxStatistics $_).ItemCount}}, Database | Export-Csv “C:\temp\UserMailboxSizes.csv” -NoTypeInformation

Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName, ProhibitSendQuota | Export-Csv “C:\temp\UserMailboxSizes.csv” -NoTypeInformation

Get-MailboxStatistics -S servername | where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –Descending | Select-Object DisplayName,  @{expression={$_.totalitemsize.value.ToMB()};label=”Size(MB)”}, LastLogonTime | Export-Csv “C:\temp\UserMailboxSizes.csv” -NoTypeInformation

 

 

You can add more columns to your statistics report

AssociatedItemCount Database DatabaseName DeletedItemCount DisconnectDate DisplayName Identity ItemCount LastLoggedOnUserAccount LastLogoffTime LastLogonTime LegacyDN MailboxGuid ServerName StorageGroupName StorageLimitStatus TotalDeletedItemSize TotalItemSize

Meer informatie

Voor meer informatie of voor een persoonlijk adviesgesprek kunt u altijd vrijblijvend contact met mij opnemen.

E-Mail

info@tuncaysahin.nl