Skip to content

Commit 80e31f1

Browse files
committed
fix: update logic for GDAP check role assignable
1 parent 8f04d56 commit 80e31f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Modules/CIPPCore/Public/Test-CIPPGDAPRelationships.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ function Test-CIPPGDAPRelationships {
5757
)
5858
$RoleAssignableGroups = $SAMUserMemberships | Where-Object { $_.isAssignableToRole }
5959
$NestedGroups = foreach ($Group in $RoleAssignableGroups) {
60+
Write-Information "Getting nested group memberships for $($Group.displayName)"
6061
New-GraphGetRequest -uri "https://graph.microsoft.com/beta/groups/$($Group.id)/memberOf?`$select=id,displayName" -NoAuthCheck $true
6162
}
6263
foreach ($Group in $ExpectedGroups) {
6364
$GroupFound = $false
6465
foreach ($Membership in ($SAMUserMemberships + $NestedGroups)) {
65-
if ($Membership.displayName -match $Group -and (($CIPPGroupCount -gt 0 -and $Group -match 'M365 GDAP') -or $Group -notmatch 'M365 GDAP')) {
66+
if ($Membership.displayName -match $Group) {
67+
Write-Information "Found $Group in group memberships"
6668
$GroupFound = $true
6769
}
6870
}

0 commit comments

Comments
 (0)