File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Users Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -140,15 +140,14 @@ Function Invoke-EditUser {
140140 if ($AddToGroups ) {
141141 $AddToGroups | ForEach-Object {
142142
143- $GroupType = $_.value.groupType -join ' , '
144- $GroupID = $_.value.groupid
145- $GroupName = $_.value.groupName
143+ $GroupType = $_.addedFields.calculatedGroupType
144+ $GroupID = $_.value
145+ $GroupName = $_.label
146146 Write-Host " About to add $ ( $UserObj.userPrincipalName ) to $GroupName . Group ID is: $GroupID and type is: $GroupType "
147147
148148 try {
149149
150150 if ($GroupType -eq ' Distribution list' -or $GroupType -eq ' Mail-Enabled Security' ) {
151-
152151 Write-Host ' Adding to group via Add-DistributionGroupMember '
153152 $Params = @ { Identity = $GroupID ; Member = $UserObj.id ; BypassSecurityGroupManagerCheck = $true }
154153 $null = New-ExoRequest - tenantid $UserObj.tenantFilter - cmdlet ' Add-DistributionGroupMember' - cmdParams $params - UseSystemMailbox $true
You can’t perform that action at this time.
0 commit comments