—Single User—
$Mailbox = Get-MailBox "Joe Bloggs"
Get-mailboxstatistics "Joe Bloggs" | ft DisplayName,TotalItemSize,StorageLimitStatus,@{name = 'IssueWarningQuota';expression = {$Mailbox.IssueWarningQuota}},@{name = 'ProhibitSendQuota';expression = {$Mailbox.ProhibitSendQuota}},@{name = 'ProhibitSendRecieveQuote';expression = {$Mailbox.ProhibitSendRecieveQuota}}
—All Users—
$Mailbox = (Get-MailBox *)
foreach ($i in $Mailbox) {Get-mailboxstatistics $i.Name | ft DisplayName,TotalItemSize,StorageLimitStatus,@{name = 'IssueWarningQuota';expression = {$i.IssueWarningQuota}},@{name = 'ProhibitSendQuota';expression = {$i.ProhibitSendQuota}},@{name = 'ProhibitSendRecieveQuote';expression = {$i.ProhibitSendRecieveQuota}} }
—All Users Filtered—
$Mailbox = (Get-MailBox *)
foreach ($i in $Mailbox) {Get-mailboxstatistics $i.SAMAccountName | where {$_.StorageLimitStatus -ne "BelowLimit"} |ft DisplayName,TotalItemSize,StorageLimitStatus,@{name = 'IssueWarningQuota';expression = {$i.IssueWarningQuota}},@{name = 'ProhibitSendQuota';expression = {$i.ProhibitSendQuota}},@{name = 'ProhibitSendRecieveQuota';expression = {$i.ProhibitSendRecieveQuota}} }
—Tidy up formatting—
$Mailbox = (Get-MailBox *)
foreach ($i in $Mailbox) {
$info +=@(Get-mailboxstatistics $i.SAMAccountName | where {$_.StorageLimitStatus -ne "BelowLimit"} |select-object DisplayName,TotalItemSize,StorageLimitStatus,@{name = 'IssueWarningQuota';expression = {$i.IssueWarningQuota}},@{name = 'ProhibitSendQuota';expression = {$i.ProhibitSendQuota}},@{name = 'ProhibitSendRecieveQuota';expression = {$i.ProhibitSendRecieveQuota}} )
}
$info | ft -autosize