File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Modules/CIPPCore/Public/Standards Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,24 @@ function Invoke-CIPPStandardMailboxRecipientLimits {
6767 if ($Plan ) {
6868 $PlanMaxRecipients = $Plan.MaxRecipientsPerMessage
6969
70+ # If mailbox has "Unlimited" set but has a plan, use the plan's limit as the current limit
71+ $CurrentLimit = if ($Mailbox.RecipientLimits -eq ' Unlimited' ) {
72+ $PlanMaxRecipients
73+ }
74+ else {
75+ $Mailbox.RecipientLimits
76+ }
77+
7078 if ($Settings.RecipientLimit -gt $PlanMaxRecipients ) {
7179 [PSCustomObject ]@ {
72- Type = ' PlanIssue'
73- Mailbox = $Mailbox
74- PlanLimit = $PlanMaxRecipients
75- PlanName = $Plan.DisplayName
80+ Type = ' PlanIssue'
81+ Mailbox = $Mailbox
82+ CurrentLimit = $CurrentLimit
83+ PlanLimit = $PlanMaxRecipients
84+ PlanName = $Plan.DisplayName
7685 }
7786 }
78- elseif ($Mailbox .RecipientLimits -ne $Settings.RecipientLimit ) {
87+ elseif ($CurrentLimit -ne $Settings.RecipientLimit ) {
7988 [PSCustomObject ]@ {
8089 Type = ' ToUpdate'
8190 Mailbox = $Mailbox
@@ -95,7 +104,7 @@ function Invoke-CIPPStandardMailboxRecipientLimits {
95104 $MailboxesWithPlanIssues = $MailboxResults | Where-Object { $_.Type -eq ' PlanIssue' } | ForEach-Object {
96105 [PSCustomObject ]@ {
97106 Identity = $_.Mailbox.Identity
98- CurrentLimit = $_.Mailbox.RecipientLimits
107+ CurrentLimit = $_.CurrentLimit
99108 PlanLimit = $_.PlanLimit
100109 PlanName = $_.PlanName
101110 }
You can’t perform that action at this time.
0 commit comments