title: In C#, how do I authenticate a user on a network machine?
body: <p>In C#, how do I authenticate a user on a network machine? For example, I want to authenticate the user <code>testuser</code> with password <code>testpassword</code> on the machine <code>EXAMPLEMACHINE</code> from a different machine which is network-connected to <code>EXAMPLEMACHINE</code>. For example, I am on <code>MYMACHINE</code> and I want to authenticate <code>testuser</code> with <code>testpassword</code> on <code>EXAMPLEMACHINE</code>.</p>
  
  <p>I have tried the following but it keeps telling me that, <strong><em>The LDAP server is unavailable</em></strong>:</p>
  
  <pre><code>PrincipalContext context =
      new PrincipalContext(ContextType.Domain, exampleMachineDomain);
  return context.ValidateCredentials(username, password);
  </code></pre>