Last post Mar 12, 2010 07:59 AM by Gonz0
Dec 13, 2005 12:07 PM|denco38|LINK
I'm new to this so please be gentle. All I'm trying to do is create a menu system from our OU tructure.So I will have like "Head Office" than inside all OU Departments etc...
Is anyone could help me on this matter. Please give example in VB.net
I know how to connect to AD but what do I do after?
Any help would be apreciated.
Dec 13, 2005 01:00 PM|dunnry|LINK
Dec 14, 2005 04:09 AM|denco38|LINK
Thank you for you help, it works butifully. Where could I find all the syntax for all
objectClass's. I know we have "user" and "organizationalUnit" but what is the syntax for all the others? Also is the search string cass sensitive?
Dec 14, 2005 09:49 AM|dunnry|LINK
Dec 15, 2005 09:17 AM|denco38|LINK
Dec 22, 2006 11:50 AM|jportelas|LINK
Mar 12, 2010 07:59 AM|Gonz0|LINK
Thanks, that helped me a lot, but I found a couple of minor syntax errors. This works:
DirectoryEntry entry = new DirectoryEntry("LDAP://DC=domain,DC=com", null, null, AuthenticationTypes.Secure);
//we were missing a comma and had stray parenthesis
DirectorySearcher ds = new DirectorySearcher(
//Must declare the SearchResultCollection here so we can Dispose in finally
//If we declare inside the try block, it doesn't exist in the finally block
SearchResultCollection src = null;
src = ds.FindAll();
foreach (SearchResult sr in src)
//you can get each OU for recursion as a DirectoryEntry like
//DirectoryEntry ou = sr.GetDirectoryEntry();