title: Active Directory Connection C#
body: <p>My purpose is to connect to the Active Directory (which runs on a virtual machine (Win SRV 2008R2)) within a console C# application and write down all the user names in the domain. Since I'm a newbie on AD I just got stuck setting a connection.</p>
  
  <p>Now first thing is first;</p>
  
  <p>Root DomainName = frt.local</p>
  
  <p>IP : 192.168.x.x</p>
  
  <p>Username: admin</p>
  
  <p>Pass : yyyy</p>
  
  <p>I have written the code below to set a connection but getting errors. Please tell me the point I missed.</p>
  
  <pre><code>DirectoryEntry entry = new DirectoryEntry();
  entry.Path = "LDAP://192.168.x.x/dc=frt.local";
  entry.Username = @"frt.local\admin";
  entry.Password = "yyyy";
  </code></pre>
  
  <p>After pointing what I missed any help would be mostly welcome about writing down the usernames to the console.</p>
  
  <p>Kind Regards</p>