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
(Helptext) Creates a new mail contact in Exchange Online across all selected tenants. The contact will be visible in the Global Address List.
11
+
(DocsDescription) This standard creates a new mail contact in Exchange Online. Mail contacts are useful for adding external email addresses to your organization's address book. They can be used for distribution lists, shared mailboxes, and other collaboration scenarios.
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Successfully created mail contact $($Settings.DisplayName) with email $($Settings.ExternalEmailAddress)"-sev Info
79
+
}
80
+
catch {
81
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Could not create mail contact. $(Get-CippException-Exception $_).NormalizedError"-sev Error
82
+
}
83
+
}
84
+
85
+
# Alert
86
+
if ($Settings.alert-eq$true) {
87
+
if ($ExistingContact) {
88
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Mail contact $($Settings.DisplayName) already exists"-sev Info
89
+
}
90
+
else {
91
+
Write-StandardsAlert-message "Mail contact $($Settings.DisplayName) needs to be created"-object $ContactData-tenant $Tenant-standardName 'DeployMailContact'-standardId $Settings.standardId
92
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Mail contact $($Settings.DisplayName) needs to be created"-sev Info
(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 "Found $($MailboxesWithPlanIssues.Count) mailboxes where the requested recipient limit ($($Settings.RecipientLimit)) exceeds their mailbox plan limit. These mailboxes will not be updated."-sev Info
115
+
foreach ($Mailboxin$MailboxesWithPlanIssues) {
116
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Mailbox $($Mailbox.Identity) has plan $($Mailbox.PlanName) with maximum limit of $($Mailbox.PlanLimit)"-sev Info
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Successfully set recipient limits to $($Settings.RecipientLimit) for $($MailboxesToUpdate.Count) mailboxes"-sev Info
138
+
}
139
+
catch {
140
+
$ErrorMessage=Get-CippException-Exception $_
141
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Could not set recipient limits. $($ErrorMessage.NormalizedError)"-sev Error -LogData $ErrorMessage
142
+
}
143
+
}
144
+
else {
145
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "All mailboxes already have the correct recipient limit of $($Settings.RecipientLimit)"-sev Info
146
+
}
147
+
}
148
+
149
+
# Alert
150
+
if ($Settings.alert-eq$true) {
151
+
if ($MailboxesToUpdate.Count-eq0-and$MailboxesWithPlanIssues.Count-eq0) {
152
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "All mailboxes have the correct recipient limit of $($Settings.RecipientLimit)"-sev Info
153
+
}
154
+
else {
155
+
$AlertMessage="Found $($MailboxesToUpdate.Count) mailboxes with incorrect recipient limits"
156
+
if ($MailboxesWithPlanIssues.Count-gt0) {
157
+
$AlertMessage+=" and $($MailboxesWithPlanIssues.Count) mailboxes where the requested limit exceeds their mailbox plan limit"
0 commit comments