User Id:
Password:
Forgot User ID or Password?
     
 
Facebook Twitter Linked In Stumble Upon Digg In
Articles
Database(11)
Desktop Development(3)
Development Lifecycle(2)
Dot Net Nuke(1)
Enterprise Systems(1)
Frameworks & Libraries(0)
General Programming(25)
General Reading(6)
Graphics / Design(10)
Languages(2)
Mentor Resources(0)
Mobile Development(3)
Multimedia(0)
Research Papers(1)
Social Media(1)
Software Engineering(3)
Third Party Products(0)
Web Development(11)
Add a Article
 
Articles

An Active Directory Browser

Introduction

Ever wondered how to write a simple Active Directory Browser? Well, then look at my example code here. Its quite simple and straightforward. I am utilizing System.DirectoryServices to connect to AD and enumerate objects.

Of course, this is a simple example which doesn't include threading to make the user interface respond faster. But it will give you an idea of how to connect to AD and do some simple browsing.

Code Basics

To connect to Active Directory is quite simple:

// connect to active directory 


DirectoryEntry rootDSE = new 
  DirectoryEntry("LDAP<A href="ldap://rootDSE/">://rootDSE/</A>"); 

DirectoryEntry root = new DirectoryEntry("LDAP://" + 
  (string)rootDSE.Properties["defaultNamingContext"].Value);

The property defaultNamingContext contains the domain name in format: "dc=test,dc=com" (for domain name "test.com") which we use to connect to the test.com domain.

Average: 0, Total Ratings: 0

 



FAQ Messages  newPost a Message 
There is no message currently

 
Last Updated November 19, 2018 | Advertise | Privacy Policy
Copyright © QAU Programmers, 1999-2018 All Rights Reserved. Terms of Use