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);
}
}
}
|