Skip to content

Commit e2f71c2

Browse files
committed
fix: group types in edit user
1 parent 658acea commit e2f71c2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/Identity/Administration/Users

Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/Identity/Administration/Users/Invoke-EditUser.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function Invoke-EditUser {
190190
Write-Host "About to add $($UserObj.userPrincipalName) to $GroupName. Group ID is: $GroupID and type is: $GroupType"
191191

192192
try {
193-
if ($GroupType -eq 'Distribution list' -or $GroupType -eq 'Mail-Enabled Security') {
193+
if ($GroupType -eq 'distributionList' -or $GroupType -eq 'security') {
194194
Write-Host 'Adding to group via Add-DistributionGroupMember'
195195
$Params = @{ Identity = $GroupID; Member = $UserObj.id; BypassSecurityGroupManagerCheck = $true }
196196
$null = New-ExoRequest -tenantid $UserObj.tenantFilter -cmdlet 'Add-DistributionGroupMember' -cmdParams $params -UseSystemMailbox $true
@@ -222,7 +222,7 @@ function Invoke-EditUser {
222222
Write-Host "About to remove $($UserObj.userPrincipalName) from $GroupName. Group ID is: $GroupID and type is: $GroupType"
223223

224224
try {
225-
if ($GroupType -eq 'Distribution list' -or $GroupType -eq 'Mail-Enabled Security') {
225+
if ($GroupType -eq 'distributionList' -or $GroupType -eq 'security') {
226226
Write-Host 'Removing From group via Remove-DistributionGroupMember'
227227
$Params = @{ Identity = $GroupID; Member = $UserObj.id; BypassSecurityGroupManagerCheck = $true }
228228
$null = New-ExoRequest -tenantid $UserObj.tenantFilter -cmdlet 'Remove-DistributionGroupMember' -cmdParams $params -UseSystemMailbox $true

0 commit comments

Comments
 (0)