From b8c8c8f0e2f60ea66934f33faf6d0aeb14711a32 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 7 Jan 2021 18:27:26 +0100 Subject: [PATCH] enhance exchange --- .../centreon/common/powershell/exchange/mailboxes.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/centreon-plugins/centreon/common/powershell/exchange/mailboxes.pm b/centreon-plugins/centreon/common/powershell/exchange/mailboxes.pm index fab9f3540..7ba720df1 100644 --- a/centreon-plugins/centreon/common/powershell/exchange/mailboxes.pm +++ b/centreon-plugins/centreon/common/powershell/exchange/mailboxes.pm @@ -95,10 +95,12 @@ try { } $result.group_by_databases[$mailbox.Database]++ $result.users.total++ - if ($mailbox.ProhibitSendReceiveQuota -eq "unlimited" -and $mailbox.ProhibitSendQuota -eq "unlimited") { + if ($mailbox.ProhibitSendReceiveQuota -eq "unlimited" -or $mailbox.ProhibitSendQuota -eq "unlimited") { $result.users.unlimited++ $result.users.unlimited_details.Add($detail) - } else { + } + + if ($mailbox.ProhibitSendReceiveQuota -ne "unlimited" -or $mailbox.ProhibitSendQuota -ne "unlimited") { $stat = get-mailboxStatistics -Identity $mailbox.Identity -ErrorAction SilentlyContinue if ($stat) { $size_bytes = $stat.TotalItemSize.Value.ToBytes() @@ -125,10 +127,12 @@ try { name = $mailbox.Name } $result.public_folders.total++ - if ($mailbox.ProhibitSendReceiveQuota -eq "unlimited" -and $mailbox.ProhibitSendQuota -eq "unlimited") { + if ($mailbox.ProhibitSendReceiveQuota -eq "unlimited" -or $mailbox.ProhibitSendQuota -eq "unlimited") { $result.public_folders.unlimited++ $result.public_folders.unlimited_details.Add($detail) - } else { + } + + if ($mailbox.ProhibitSendReceiveQuota -ne "unlimited" -or $mailbox.ProhibitSendQuota -ne "unlimited") { $stat = get-mailboxStatistics -Identity $mailbox.Identity -ErrorAction SilentlyContinue if ($stat) { $size_bytes = $stat.TotalItemSize.Value.ToBytes()