Learn about Windows PowerShell
Summary: Learn how to use a Windows PowerShell cmdlet to find group membership.
I want to use Windows PowerShell to find all members of a particular group in Active Directory. I would like to do this even if the membership is through other groups (indirect). What can I do?
Use the Get-ADGroupMember cmdlet from the ActiveDirectory module with the –Recursive parameter. The following illustrates this technique.
Get-ADGroupMember -Identity 'Domain Admins' -Recursive
how do i find which group does a user belong to? Recursively.
@Pankush You can do the following: Get-ADUser -Identity myusername -Properties memberof
yes, that can be used, but that would not be recursive. This list would not give me the membership of any "next level groups" that these groups belong to. Please let me know if i am wrong in saying that.
For e.g. UserA belongs to a group called XYZ. The XYZ group may further belong to another group ABC. and that ABC might further belong to other groups. How can we get that complete chain?
Get-ADAccountAuthorizationGroup -identity <accountname>
This provides security group memberships recursively for the account.
Iam new to powershall, i Wanted to know how to pull list of users from a groups.
What if you want to find all groups with a specific group member?