Query a/d a users group membership

  • Thread starter Thread starter David BUck
  • Start date Start date
D

David BUck

I am looking for the attribute name of the "member of"
tab for an A/D user. I would like a script to list all
groups for a given user.

Thanks

Dave
 
memberof is the attribute.

Note that doing the listing of groups if you count primary and nested is not
a trivial task. If you count memberships in other domains of the forest it
is an incredible pain.

If you truly want to script it, go check out the adsi.general old posts as
there is info there. If you just want a tool that does most of it go check
out memberof on the free win32 tools page of www.joeware.net
 
Hey - if you just want to be able to check this one user
at a time you can try using dsquery and dsget.

(I think you have to be on XP)

From cmd, type:

dsquery user -name [name*]

This will output the UserDN. Copy this. ( I have the
most success if I copy this output than writing the
userdn from scratch.)


dsget user [userDN] -memberof -expand

double check the syntax for both these commands of course

dsquery user /?
dsget user /?


Hope this helps.

I know this is not a script but of course, if you know
the commands you can always write the script.
 
Back
Top