Situatie
Afla daca un utilizator este in unul sau mai multe grupuri in ActiveDirectory folosind POWERSHELL: $Groups = "Group1","Group2" $GroupHash = @{} ForEach ($Group in $Groups) { $GroupHash.Add((Get-ADGroup $Group).distinguishedName,(New-Object PSObject -Property @{ GroupName = $Group;Count = 0 })) } $Results = ForEach ($User in (Get-ADUser -Filter * -Properties MemberOf)) { $NotFound = $true ForEach ($Group in $User.MemberOf) { If ($GroupHash.ContainsKey($Group)) { $NotFound = $false Break } } If ($NotFound) { $User } } $Results | Select SamAccountName,Name,distinguishedName | Sort Name
Leave A Comment?