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 for deploying mail contacts in CIPP standards.
This script provides functionality to manage and deploy mail contact configurations
across tenant environments.
Tweak to prevent early code exit
Further adjustment to code execution
Streamlined
(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
0 commit comments