>Hello there. I have a method that pulls out the members of a group in
the form of distinguishedName. I read somewhere that I could then
connect to the Directory with:
DirectoryEntry(@"LDAP://servername/" + dnPulledFromGroup)
and somehow pull the user CN in this fashion. Could someone point me
in the direction of how this might be achieved?
It won't work - where did you read that??
If you have only the user's RDN (relative distinguished name, e.g.
"CN=John Doe"), there's no way to just "bind" to that user - after
all, that user could be ANYWHERE in your AD tree!
What you can do is do a search for that user, based on this RDN - set
up a DirectorySearcher, set the start location, and use that RDN as a
search criteria on the "distinguishedName" attribute. That should
work. You would then get back whatever attributes from the user that
you need - or the whole DirectoryEntry for that user, if need be.
HTH
Marc