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
Accumulate nested group memberships into a typed List and use AddRange to correctly collect results from Graph queries. Rename loop variables to avoid shadowing ($RoleGroup / $ExpectedGroup) and update matching/log messages accordingly. Include nested groups in the returned Memberships so missing-group detection considers indirect membership; preserve AdminAgents as an error-level issue.
Write-Information"Found $Group in group memberships"
67
+
if ($Membership.displayName-match$ExpectedGroup) {
68
+
Write-Information"Found $ExpectedGroup in group memberships"
68
69
$GroupFound=$true
69
70
}
70
71
}
71
72
if (-not$GroupFound) {
72
-
if ($Group-eq'AdminAgents') { $Type='Error' } else { $Type='Warning' }
73
+
if ($ExpectedGroup-eq'AdminAgents') { $Type='Error' } else { $Type='Warning' }
73
74
$GDAPissues.add([PSCustomObject]@{
74
75
Type=$Type
75
-
Issue="$($Group) is not assigned to the SAM user $me. If you have migrated outside of CIPP this is to be expected. Please perform an access check to make sure you have the correct set of permissions."
76
+
Issue="$($ExpectedGroup) is not assigned to the SAM user $me. If you have migrated outside of CIPP this is to be expected. Please perform an access check to make sure you have the correct set of permissions."
0 commit comments