Directory Searcher Exception

0

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;
c#
.net
asked on Stack Overflow Sep 26, 2013 by Numan Hanif • edited Sep 26, 2013 by Uwe Keim

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0