title: How does PrincipalContext login to domain server
body: <p>I have the following C# code that connects to my domain server and performs some actions on it.  Everything works fine on my computer and I can run all my commands just fine.  </p>
  
  <p>My questions is: what credentials are used for the connection to the server? I assume it uses the current users credentials. So my real question is will this work on a normal user. I am an admin and it works fine on my machine.  </p>
  
  <p>However I am wondering if the same would hold true for a non admin?</p>
  
  <pre><code>PrincipalContext AD = new PrincipalContext(ContextType.Domain, "172.18.4.4");
  
  UserPrincipal u = new UserPrincipal(AD);
  u.SamAccountName = Environment.UserName;
  
  PrincipalSearcher search = new PrincipalSearcher(u);
  
  UserPrincipal result = (UserPrincipal)search.FindOne();
  </code></pre>