G
Guest
string strLdap = "LDAP://OU=Sales,DC=Company,DC=com"
DirectoryEntry objOU = new DirectoryEntry(strLdap);
DirectorySearcher objUserSearcher = new DirectorySearcher(objOU);
SearchResultCollection objResults;
//Search for user objects
objUserSearcher.PropertiesToLoad.Add("cn");
objUserSearcher.Filter = "(objectClass=user)";
objResults = objUserSearcher.FindAll();
DropDownList1.Items.Add("New User");
//Loop through the search results adding each one to the combo box
foreach (SearchResult objResult in objResults)
DropDownList1.Items.Add(objResult.Properties["cn"][0]);
What am I doing wrong here...
DirectoryEntry objOU = new DirectoryEntry(strLdap);
DirectorySearcher objUserSearcher = new DirectorySearcher(objOU);
SearchResultCollection objResults;
//Search for user objects
objUserSearcher.PropertiesToLoad.Add("cn");
objUserSearcher.Filter = "(objectClass=user)";
objResults = objUserSearcher.FindAll();
DropDownList1.Items.Add("New User");
//Loop through the search results adding each one to the combo box
foreach (SearchResult objResult in objResults)
DropDownList1.Items.Add(objResult.Properties["cn"][0]);
What am I doing wrong here...