Click here to Skip to main content
Click here to Skip to main content

Simple Active Directory Browser

, 16 Dec 2003 CPOL
Rate this:
Please Sign up or sign in to vote.
A simple Active Directory Browser for beginners.

Sample Image - ActiveDirectoryBrowser.jpg


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.

I also used my listview column sorter class, which is available here.

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://" + 

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


  • 2003-11-04 - First edition, more updates will come later.
  • 2003-11-13 - Dominic found a bug. I uploaded a new example project that fixes the bug.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Sven So.
Software Developer (Senior) biggest furniture dealer in the world
Germany Germany
No Biography provided

Comments and Discussions

QuestionLicense Terms PinmemberManual178921-Dec-12 4:14 
AnswerRe: License Terms PinmemberSven So.3-Jan-13 0:20 
QuestionHaving trouble figuring out images PinmemberDavid Bayer23-Sep-09 4:10 
AnswerRe: Having trouble figuring out images PinmemberSven So.23-Sep-09 5:42 
GeneralRe: Having trouble figuring out images PinmemberDavid Bayer23-Sep-09 6:16 
GeneralRe: Having trouble figuring out images PinmemberDavid Bayer23-Sep-09 6:30 
GeneralRe: Having trouble figuring out images PinmemberSven So.23-Sep-09 23:26 
GeneralDisplay Properties PinmemberR.Palanivel3-Jun-09 1:03 
QuestionRe: Display Properties PinmemberSven So.5-Jun-09 4:58 
AnswerRe: Display Properties PinmemberR.Palanivel7-Jun-09 1:53 
GeneralGood GUI PinmemberZhefu Zhang2-Jan-04 15:27 
GeneralBitmaps PinsussBruce Cutler16-Dec-03 12:35 
GeneralRe: Bitmaps Pinmemberstotti_no116-Dec-03 20:39 
GeneralRe: Bitmaps PinmemberSaurweinAndreas17-Dec-03 3:59 
GeneralRe: Bitmaps Pinmemberstotti_no14-Jan-04 22:27 
GeneralDomains Pinmembersevenstorydrop15-Nov-03 10:56 
GeneralRe: Domains Pinmemberscatter15-Nov-03 11:09 
GeneralRe: Domains Pinmembersevenstorydrop16-Nov-03 14:36 
GeneralRe: Domains Pinmemberstotti_no117-Nov-03 20:40 
GeneralRe: Domains PinsussDaniel Romano10-Mar-05 11:40 
GeneralSorting columns error Pinsussjsk647814-Nov-03 4:40 
GeneralRe: Sorting columns error Pinmemberstotti_no117-Nov-03 20:38 
GeneralRe: Sorting columns error Pinsussjsk647818-Dec-03 6:38 
GeneralCan't get it to work PinmemberDomenic12-Nov-03 8:09 
GeneralRe: Can't get it to work Pinmemberstotti_no112-Nov-03 21:50 
GeneralRe: Can't get it to work PinmemberDomenic13-Nov-03 3:23 
GeneralRe: Can't get it to work Pinmemberstotti_no113-Nov-03 3:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150326.1 | Last Updated 17 Dec 2003
Article Copyright 2003 by Sven So.
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid