retrieves Active Directory information

image_pdfimage_print
   


using System;
using System.DirectoryServices;

public class Example21_16 
{

  public static void Main() 
  {

    // connect to AD
    DirectoryEntry de = new DirectoryEntry(
      "WinNT://DomanName/MachineName", "Administrator", "Password");

    foreach(DirectoryEntry child in de.Children) 
    {
      Console.WriteLine(child.SchemaClassName + ": " + child.Name);
    }
  }

}




           
          


This entry was posted in Web Services. Bookmark the permalink.