DirectoryServices DirectoryEntry : Active Directory « Web Services « C# / C Sharp






DirectoryServices DirectoryEntry

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

}

 








Related examples in the same category

1.Using DirectorySearcher
2.retrieves Active Directory information
3.DirectoryEntry Get PropertiesDirectoryEntry Get Properties
4.DirectoryEntry : List Objects
5.DirectoryServices:Modify Property
6.DirectoryEntry and DirectoryEntries
7.DirectoryEntry Rename Object
8.DirectoryServices: Simple Search
9.DirectoryServices: Add Object
10.DirectoryServices: Add Property
11.DirectoryServices Bind ObjectDirectoryServices Bind Object
12.DirectoryServices: Delete Object
13.DirectoryServices GUI