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.
(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
88
+
}
89
+
catch {
90
+
$ErrorMessage=Get-CippException-Exception $_
91
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Could not create mail contact. $($ErrorMessage.NormalizedError)"-sev Error -LogData $ErrorMessage
92
+
}
93
+
}
94
+
95
+
# Alert
96
+
if ($Settings.alert-eq$true) {
97
+
if ($ExistingContact) {
98
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message "Mail contact $($Settings.DisplayName) already exists"-sev Info
99
+
}
100
+
else {
101
+
Write-StandardsAlert-message "Mail contact $($Settings.DisplayName) needs to be created"-object @{
0 commit comments