You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add new PowerShell script to standardize mailbox recipient limits across tenants.
This script will help enforce consistent recipient limits for mailboxes in the CIPP platform.
(Helptext) Sets the maximum number of recipients that can be specified in the To, Cc, and Bcc fields of a message for all mailboxes in the tenant.
11
+
(DocsDescription) This standard configures the recipient limits for all mailboxes in the tenant. The recipient limit determines the maximum number of recipients that can be specified in the To, Cc, and Bcc fields of a message. This helps prevent spam and manage email flow.
if ([Int32]$Settings.RecipientLimit-lt0-or [Int32]$Settings.RecipientLimit-gt10000) {
32
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message 'MailboxRecipientLimits: Invalid RecipientLimit parameter set. Must be between 0 and 10000.'-sev Error
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Successfully set recipient limits to $($Settings.RecipientLimit) for $($MailboxesToUpdate.Count) mailboxes"-sev Info
53
+
}
54
+
catch {
55
+
$ErrorMessage=Get-CippException-Exception $_
56
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Could not set recipient limits. $($ErrorMessage.NormalizedError)"-sev Error -LogData $ErrorMessage
57
+
}
58
+
}
59
+
else {
60
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "All mailboxes already have the correct recipient limit of $($Settings.RecipientLimit)"-sev Info
61
+
}
62
+
}
63
+
64
+
# Alert
65
+
if ($Settings.alert-eq$true) {
66
+
if ($MailboxesToUpdate.Count-eq0) {
67
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "All mailboxes have the correct recipient limit of $($Settings.RecipientLimit)"-sev Info
0 commit comments