Skip to content

Commit

Permalink
Update powershell/internal/Test-MtCaInvalidGroupsAssigned.ps1
Browse files Browse the repository at this point in the history
Co-authored-by: Fabian Bader <f-bader@users.noreply.github.com>
  • Loading branch information
Cloud-Architekt and f-bader authored Oct 27, 2024
1 parent ff3e0e1 commit 956c4ce
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions powershell/internal/Test-MtCaInvalidGroupsAssigned.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ Function Test-MtCaInvalidGroupsAssigned {
$testDescription = "Conditional Access Policies should not target to security groups which are not exists anymore."
$Policies = Get-MtConditionalAccessPolicy

$Groups = $Policies.conditions.users | Where-Object {
@($_.includeGroups).Count -gt 0 -or @($_.excludeGroups).Count -gt 0
} | ForEach-Object {
$_.includeGroups + $_.excludeGroups
} | Select-Object -Unique
$Groups = $Policies.conditions.users.includeGroups + $Policies.conditions.users.excludeGroups | Select-Object -Unique

if ($Groups.Count -lt 50) {
$GroupsWhichNotExist = [System.Collections.Concurrent.ConcurrentBag[psobject]]::new()
Expand Down

0 comments on commit 956c4ce

Please sign in to comment.