Skip to content

Commit d4bf4a6

Browse files
committed
add follow up command to update dynamic group for sender auth
1 parent 815cb33 commit d4bf4a6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Groups/Invoke-AddGroup.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ function Invoke-AddGroup {
6262
PrimarySmtpAddress = $Email
6363
}
6464
$GraphRequest = New-ExoRequest -tenantid $tenant -cmdlet 'New-DynamicDistributionGroup' -cmdParams $ExoParams
65+
66+
if (!$GroupObject.allowExternal) {
67+
$SetParams = @{
68+
RequireSenderAuthenticationEnabled = [bool]!$GroupObject.allowExternal
69+
Name = $GroupObject.displayName
70+
PrimarySmtpAddress = $Email
71+
}
72+
$GraphRequest = New-ExoRequest -tenantid $tenant -cmdlet 'Set-DynamicDistributionGroup' -cmdParams $SetParams
73+
}
6574
} else {
6675
$ExoParams = @{
6776
Name = $GroupObject.displayName

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardGroupTemplate.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ function Invoke-CIPPStandardGroupTemplate {
7575
PrimarySmtpAddress = $email
7676
}
7777
$GraphRequest = New-ExoRequest -tenantid $tenant -cmdlet 'New-DynamicDistributionGroup' -cmdParams $params
78+
79+
if (!$groupobj.AllowExternal) {
80+
$SetParams = @{
81+
RequireSenderAuthenticationEnabled = [bool]!$groupobj.AllowExternal
82+
Name = $groupobj.Displayname
83+
PrimarySmtpAddress = $email
84+
}
85+
$GraphRequest = New-ExoRequest -tenantid $tenant -cmdlet 'Set-DynamicDistributionGroup' -cmdParams $SetParams
86+
}
7887
} else {
7988
$Params = @{
8089
Name = $groupobj.Displayname

0 commit comments

Comments
 (0)