Hello,
this is what i want to do: Check if a user is in a specific directory. Which means he or a group he belongs to can be in this specific directory so that the user gets access.
First of all i try to define the root directory for the search:
DirectoryEntry rootDirectory = new DirectoryEntry(LDAP://OU=c,OU=b,OU=a,DC=business,DC=ad,DC=company);Is an OU unique? I thought not so the root to the desired directory is a->b->c therefore i am using all three OU's to define the root. The search should only happen in this rootDirectory!
So the questions: Is an OU unique? If not can i use multiple OU to define the root?
Ok after i define the root i create a DirectorySearcher Object
with filter format (SAMAccountName={0}) and memberof property to search for the current user.
If the group of a user is in the rootDirectory (which means he is authenticated) does this search find this user?
Thanks for your answers!
tywinPosted Feb 4, 2009, 6:36 AM
ok i know now that multiple OU define the directory root and it's ok to use it this way.
Now i have some CN (common name) in this OU and i want to search them if the user is in one of these CN.
How to do that?