Last post May 03, 2011 04:43 AM by smirnov
May 02, 2011 07:04 PM|DevLegend|LINK
Hello all. My IS manager provided me with parameters in this format and I am trying use C# to validate a user against Active directory.
Here is a code sample (of course not the real credentials). How do i use these parameters to against a DirectoryEntry object so I can search for users
Thanks for your time. I know this should be simple but its been years since ive programmed active directory.
May 03, 2011 04:43 AM|smirnov|LINK
DirectoryEntry de = new DirectoryEntry("LDAP://DC=acmetecg,DC=com");
DirectorySearcher s = new DirectorySearcher(de);
s.SearchScope = SearchScope.Subtree;
s.Filter = "(objectClass=user)";
s.PageSize = 1000;
SearchResultCollection results = s.FindAll();
foreach (SearchResult result in results)
In case, you would need to check ldap path, or see other properties, I would recommend to use LDAP Browser.
Hope this helps.