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
|