Last post Oct 23, 2006 12:42 AM by objectmentor
Oct 19, 2006 06:33 PM|jera300|LINK
I am trying to generate a list of all Active Directory user names and several attributes associated with that user. I would like to populate a bulletedlist with the username as the link text. I am currently using visual developer 2005 and vb.
I guess i'm not grasping the context of the DirectorySearcher so any code snippets or a nudge in the right direction would be very helpfull.
Thanks - Jeremy
Oct 23, 2006 12:42 AM|objectmentor|LINK
you should create a DirectorySearcher
DirectorySearcher objLDAPSearcher = null;
objLDAPSearcher = new DirectorySearcher(...);
string strLDAPFilter = "(&(objectCategory=person)(objectClass=user))";
objLDAPSearcher.Filter = strLDAPFilter;
string lstProperties = list of properties or attibute need to get
SearchResultCollection colResults = objLDAPSearcher.FindAll();
foreach (SearchResult Result
ResultPropertyCollection colResultProperty = Result.Properties;...
... hope it helps