Every admin has gotten the question, “What group is that user in which granted him those permissions?” I have combined a few scripts to create a list of all of a user’s groups, and included the nesting of groups memberships. Get-ADGroupMemberships.ps1 is based on a script by I.C.A. Strahan, here. My version adds information about whether a group is a security group, and displays the full SamAccountName for the group, including the domain. For speed, I used NameTranslate for this information, instead of binding to each group for the information.
Included is a function Get-AllSecurityGroupsForUser, which is based on Get-AllGroupsForUser, found in comments below this post in the Hey Scripting Guy Forum. This is an extraordinarily fast way to get all of the security groups for a user.
Please specify the URL of your file