web app mit hinzugefügt

This commit is contained in:
2026-06-17 07:40:52 +02:00
parent fedd8898d7
commit 2f271265e9
24 changed files with 14651 additions and 11 deletions
@@ -37,7 +37,8 @@ function Get-GraphGroup {
$select = if ($Property) { "&`$select=" + ($Property -join ",").ToLower() } else { "" }
if ($GroupId) {
$uri = "https://graph.microsoft.com/v1.0/groups/$GroupId`?`$select=" + ($Property -join ",").ToLower()
$selectPart = if ($Property) { "?`$select=" + ($Property -join ",").ToLower() } else { "" }
$uri = "https://graph.microsoft.com/v1.0/groups/$GroupId$selectPart"
return Invoke-MgGraphRequest -Uri $uri -Method GET
}
else {
@@ -1614,21 +1615,29 @@ function Update-MembershipIndicators {
$memberships = @()
if ($target.Type -eq "User") {
# Benutzer: Direkte Gruppenmitgliedschaften laden
$groups = Get-MgUserMemberOf -UserId $target.Id -All -Property Id 2>$null
foreach ($g in $groups) {
if ($g.AdditionalProperties.'@odata.type' -eq '#microsoft.graph.group') {
$memberships += $g.Id
$uri = "https://graph.microsoft.com/v1.0/users/$($target.Id)/memberOf?`$select=id"
do {
$response = Invoke-MgGraphRequest -Uri $uri -Method GET
foreach ($g in $response.value) {
if ($g.'@odata.type' -eq '#microsoft.graph.group') {
$memberships += $g.id
}
}
}
$uri = $response.'@odata.nextLink'
} while ($uri)
}
else {
# Gruppe: Transitive Mitgliedschaften laden (Gruppe ist Mitglied von...)
$groups = Get-MgGroupMemberOf -GroupId $target.Id -All -Property Id 2>$null
foreach ($g in $groups) {
if ($g.AdditionalProperties.'@odata.type' -eq '#microsoft.graph.group') {
$memberships += $g.Id
$uri = "https://graph.microsoft.com/v1.0/groups/$($target.Id)/memberOf?`$select=id"
do {
$response = Invoke-MgGraphRequest -Uri $uri -Method GET
foreach ($g in $response.value) {
if ($g.'@odata.type' -eq '#microsoft.graph.group') {
$memberships += $g.id
}
}
}
$uri = $response.'@odata.nextLink'
} while ($uri)
}
$script:membershipCache[$target.Id] = $memberships
}