title: Search a user login id by first name and last name
body: <p>I found <a href="https://stackoverflow.com/questions/5162897/how-can-i-get-a-list-of-users-from-active-directory">How can I get a list of users from active directory?</a> </p>
  
  <p>It is helpful when I only have a few users, but I have so many users in AD, so when I run my query </p>
  
  <pre><code>if ((String)(entry.Properties["sn"].Value) == "lname"
       &amp;&amp; (String)(entry.Properties["givenName"].Value) == "fname")
  {
      return entry.Properties["samAccountName"].Value.ToString();
  }
  </code></pre>
  
  <p>it took too long to finish.</p>
  
  <p>What can I do to search one particular user logon id by first name and last name? </p>