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
# Ugly, but i needed to create a scope/loop i could break out of without breaking the rest of the function
247
252
foreach ($din$Domain) {
@@ -250,7 +255,7 @@ function Push-DomainAnalyserDomain {
250
255
if ($Result.DKIMEnabled-eq$true) {
251
256
continue
252
257
}
253
-
# Test if its a onmicrosft.com domain, skip domain if it is
258
+
# Test if its a onmicrosoft.com domain, skip domain if it is
254
259
if ($Domain-match'onmicrosoft.com') {
255
260
continue
256
261
}
@@ -264,28 +269,21 @@ function Push-DomainAnalyserDomain {
264
269
}
265
270
}
266
271
272
+
# Get the DKIM record from EXO. This is the only way to get the correct values for the MSCNAME records since the new format was introduced in May 2025.
# Compute the DKIM CNAME records from $Tenant.InitialDomainName according to this logic: https://learn.microsoft.com/en-us/defender-office-365/email-authentication-dkim-configure#syntax-for-dkim-cname-records
269
-
# Test if it has a - in the domain name
270
-
if ($Domain-like'*-*') {
271
-
Write-Information'Domain has a - in it. Got to query EXO for the right values'
Copy file name to clipboardExpand all lines: Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Email-Exchange/Administration/Invoke-AddSharedMailbox.ps1
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Function Invoke-AddSharedMailbox {
$Results.Add("Send Copies of team emails and events to team members inboxes for $($UserObj.mail) enabled.")
388
+
Write-LogMessage-headers $Headers-API $APIName-tenant $TenantId-message "Send Copies of team emails and events to team members inboxes for $($UserObj.mail) enabled."-Sev 'Info'
389
+
} else {
390
+
# Disable send copies. Has to be done in 2 calls, otherwise it fails saying AutoSubscribeNewMembers cannot be true when subscriptionEnabled is false.
391
+
# Why this happens and can't be done in one call, only Bill Gates and the mystical gods of Exchange knows.
$Results.Add("Send Copies of team emails and events to team members inboxes for $($UserObj.mail) disabled.")
398
+
Write-LogMessage-headers $Headers-API $APIName-tenant $TenantId-message "Send Copies of team emails and events to team members inboxes for $($UserObj.mail) disabled."-Sev 'Info'
371
399
}
372
-
373
-
$body=$Results.Add("Send Copies of team emails and events to team members inboxes for $($UserObj.mail) enabled.")
374
-
Write-LogMessage-headers $Headers-API $APIName-tenant $TenantId-message "Send Copies of team emails and events to team members inboxes for $($UserObj.mail) enabled."-Sev 'Info'
375
400
} catch {
376
-
Write-Warning"Error in SendCopies: $($_.Exception.Message) - $($_.InvocationInfo.ScriptLineNumber)"
377
-
Write-Warning ($_.InvocationInfo.PositionMessage)
378
-
$body=$Results.Add("Failed to Send Copies of team emails and events to team members inboxes for $($UserObj.mail).")
379
-
Write-LogMessage-headers $Headers-API $APIName-tenant $TenantId-message "Failed to Send Copies of team emails and events to team members inboxes for $($UserObj.mail). Error:$($_.Exception.Message)"-Sev 'Error'
401
+
$ErrorMessage=Get-CippException-Exception $_
402
+
Write-Warning"Error in SendCopies: $($ErrorMessage.NormalizedError) - $($_.InvocationInfo.ScriptLineNumber)"
$Results.Add("Failed to $action Send Copies of team emails and events to team members inboxes for $($UserObj.mail).")
405
+
Write-LogMessage-headers $Headers-API $APIName-tenant $TenantId-message "Failed to $action Send Copies of team emails and events to team members inboxes for $($UserObj.mail). Error:$($ErrorMessage.NormalizedError)"-Sev 'Error'-LogData $ErrorMessage
0 commit comments