title: Finding a User in Active Directory with the Login Name
body: <p>I'm possibly just stupid, but I'm trying to find a user in Active Directory from C#, using the Login name ("domain\user").</p>
  
  <p>My "Skeleton" AD Search Functionality looks like this usually:</p>
  
  <pre><code>de = new DirectoryEntry(string.Format("LDAP://{0}", ADSearchBase), null, null, AuthenticationTypes.Secure);
  ds = new DirectorySearcher(de);
  ds.SearchScope = SearchScope.Subtree;
  ds.PropertiesToLoad.Add("directReports");
  ds.PageSize = 10;
  ds.ServerPageTimeLimit = TimeSpan.FromSeconds(2);
  SearchResult sr = ds.FindOne();
  </code></pre>
  
  <p>Now, that works if I have the full DN of the user (ADSearchBase usually points to the "Our Users" OU in Active Directory), but I simply have no idea how to look for a user based on the "domain\user" syntax.</p>
  
  <p>Any Pointers?</p>