views:

20

answers:

0

Hello,

  1. I have a AD lightweight instance for testing purposes running on a windoows server 2008 R2
  2. Created an AD structure that contains a container called Roles
  3. container Roles contains a bunch of groups (A, B and C)
  4. Binded a windows security principal (USER) to one of the groups (group A)
  5. Added group A to group B as a member (by adding its DN) ~ I figured that would nest group A under B

  6. Authenticated USER running an application from a client. (all coding is in C#)

  7. So now what I'd like to do is the following:

    ------from the client all I have is the username/password of USER. But I do not have its DN. How do I figure that out?

    ------figure out all the groups that USER is a member of (including parents of their immediate groups)

Any tips you can assist me with for steps 8 and 9 that would be great!

someone mentioned I could use the following for number 9:

dsquery user -samid (user login ID) |dsget user -memberof -expand | dsget group -samid

But I'm coding in C# and not sure what to do with that query.

Regards