Skip to content

Commit 4f88eda

Browse files
authored
Merge pull request KelvinTegelaar#1531 from StoricU/dev
Fix: Handle 'Unlimited' values and format send/receive limits correctly in SendReceiveLimitTenant
2 parents e5770af + a15c829 commit 4f88eda

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardSendReceiveLimitTenant.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ function Invoke-CIPPStandardSendReceiveLimitTenant {
4343
}
4444

4545
$AllMailBoxPlans = New-ExoRequest -tenantid $Tenant -cmdlet 'Get-MailboxPlan' | Select-Object DisplayName, MaxSendSize, MaxReceiveSize, GUID
46-
$MaxSendSize = $Settings.SendLimit * 1MB
47-
$MaxReceiveSize = $Settings.ReceiveLimit * 1MB
46+
$MaxSendSize = "$($Settings.SendLimit)MB"
47+
$MaxReceiveSize = "$($Settings.ReceiveLimit)MB"
48+
$MaxSendSizeBytes = $Settings.SendLimit * 1MB
49+
$MaxReceiveSizeBytes = $Settings.ReceiveLimit * 1MB
4850

4951
$NotSetCorrectly = foreach ($MailboxPlan in $AllMailBoxPlans) {
5052
if ($MailboxPlan.MaxSendSize -eq 'Unlimited') {
@@ -59,7 +61,7 @@ function Invoke-CIPPStandardSendReceiveLimitTenant {
5961
$PlanMaxReceiveSize = [int64]($MailboxPlan.MaxReceiveSize -replace '.*\(([\d,]+).*', '$1' -replace ',', '')
6062
}
6163

62-
if ($PlanMaxSendSize -ne $MaxSendSize -or $PlanMaxReceiveSize -ne $MaxReceiveSize) {
64+
if ($PlanMaxSendSize -ne $MaxSendSizeBytes -or $PlanMaxReceiveSize -ne $MaxReceiveSizeBytes) {
6365
$MailboxPlan
6466
}
6567
}

0 commit comments

Comments
 (0)