Forum Discussion
mailbox stats
- May 09, 2018
You have some double recursion in the above script, you need to clean it up a bit:
foreach ($user in Get-Mailbox -ResultSize Unlimited) {
$stats = Get-MailboxStatistics $user.UserPrincipalName
New-Object -TypeName PSObject -Property @{
DisplayName = $User.DisplayName
IssueWarningQuota = $User.IssueWarningQuota
ProhibitSendQuota = $User.ProhibitSendQuota
ProhibitSendReceiveQuota = $User.ProhibitSendReceiveQuota
TotalItemSize = $stats.TotalItemSize
AuditEnabled = $User.AuditEnabled
}
}
You have some double recursion in the above script, you need to clean it up a bit:
foreach ($user in Get-Mailbox -ResultSize Unlimited) {
$stats = Get-MailboxStatistics $user.UserPrincipalName
New-Object -TypeName PSObject -Property @{
DisplayName = $User.DisplayName
IssueWarningQuota = $User.IssueWarningQuota
ProhibitSendQuota = $User.ProhibitSendQuota
ProhibitSendReceiveQuota = $User.ProhibitSendReceiveQuota
TotalItemSize = $stats.TotalItemSize
AuditEnabled = $User.AuditEnabled
}
}