title: Unknown Error (0x80005000) with LDAPS Connection
body: <p>I've been stuck for the last couple of hours on an annoying Active Directory bit.</p>
  
  <p>What I'm trying to accomplish is connect to an Active Directory via LDAP over SSL. The authentication type is anonymous. I'm using .NET Framework 4.0, C# and Visual Studio 2010.</p>
  
  <p>The following code should work according to various online resources. But it keeps coming up with the amazing self-explanatory: 'Unknown Error (0x80005000)'.</p>
  
  <pre><code>DirectoryEntry entry = new DirectoryEntry();
  entry.Path = "LDAPS://some.ldap.server:636";
  entry.AuthenticationType = AuthenticationTypes.SecureSocketsLayer;
  
  DirectorySearcher searcher = new DirectorySearcher();
  searcher.searchRoot = entry;
  searcher.Filter = "(&amp;(objectCategory=person)(objectClass=user))";
  
  SearchResultCollection results = searcher.FindAll();
  </code></pre>
  
  <p>I've simplified the actual query I want to perform to the one you find in the code. But even with this generic query (it should return work on every AD?) it returns the error.</p>