
Why PowerShell?
You know how painful and error prone it is to check access for user to an application that has 10+ security groups using the Active Directory Users and Computers GUI?
Throw in some task switching between task and calls and you know my pain.
Welcome to Powershell. Here is how to get security group and it’s selective members below:
# level 1: View single user and group belong to via distinguishedname
Get-ADUser -Identity "bbanner" -Property MemberOf | Select-Object -ExpandProperty MemberOf
# level 2: View single user and group belong to via Human readable name
$user = Get-ADUser "bbanner" -Properties MemberOf
($user.MemberOf | ForEach-Object { Get-ADGroup -Identity $_ }).Name
# View Group and batch Users in Group via human Readable Output
$group = "Scientists"
$members_of_group = "thor", "bbanner", "nromanoff"
echo ""
echo "GROUP DETAILS"
Get-ADGroup -Identity $group
echo "LIST OF USERS:"
Get-ADGroupMember -Identity $group | where-Object {$_.samaccountname -in @($members_of_group)} | Select-Object name | ForEach-Object { write-host $_.name "is in $group group" }
Herer are 3 individual scripts. Level 3 is easiest to read and reuse, just put the security group and members name you want to find. Your welcome :).

Use GUI less, use powershell more.
See more of my powershell scripting at my github https://github.com/PhysioFred/PowerShell-Scripts