DirectoryServices DirectoryEntry : Active Directory : Web Services C# Source Code


Custom Search

C# Source Code » Web Services » Active Directory »

 

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

}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Web Services
» Active Directory