I have written following code to search directory but Searcher.FindOne();
i got exception [Unknown error (0x80005000)]
bool Success = false;
System.DirectoryServices.DirectoryEntry Entry =
new System.DirectoryServices.DirectoryEntry("LDAP://" + Domain, Username, Password);
System.DirectoryServices.DirectorySearcher Searcher =
new System.DirectoryServices.DirectorySearcher(Entry);
Searcher.SearchScope = System.DirectoryServices.SearchScope.OneLevel;
try
{
System.DirectoryServices.SearchResult Results = Searcher.FindOne();
Success = (Results != null);
}
catch
{
Success = false;
}
return Success;
User contributions licensed under CC BY-SA 3.0