In the last LDAP series post, I mentioned how to search for the members of a group. Now the opposite, here's how to search for what groups a particular user is a part of:
To do this search, all I do is form a search filter that is searching for all groups that has a particular member in it. So really this is a slight alteration of the search for all groups.
Here I can see that I (CN=Lance Robinson,CN=Users,DC=JUNGLE) am a member of two groups: Domain Admins and DNS Admins. That sounds a lot cooler than it actually is since "testboy" is just a test machine. ;)
Technorati Tags: PowerShell, NetCmdlets, ldap, active directory