using System;
using System.Net;
using System.DirectoryServices;
using System.DirectoryServices.Protocols;
public class MainClass {
public static void Main() {
using (DirectoryEntry de = new DirectoryEntry()) {
de.Path = "LDAP://yourSite/rootDSE";
de.Username = @"explorer\chris";
de.Password = "password";
PropertyCollection props = de.Properties;
foreach (string prop in props.PropertyNames) {
PropertyValueCollection values = props[prop];
foreach (string val in values) {
Console.Write(prop + ": ");
Console.WriteLine(val);
}
}
}
}
}
|