Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Dynamically Browse Active Directory Objects

0.00/5 (No votes)
1 Feb 2004 1  
A simple program which lets you browse containers of your Active Directory

Introduction

This tip shows you how to browse your Active Directory using the Simple AD Browser. The Windows Forms project is quite simple. It contains a treeview control for navigating and expanding AD objects and a listview object showing the selected object data. A connection dialog allows you to initially connect to an AD or change connection to another AD. The solution consists of two projects:

  1. the above mentioned Windows Forms project
  2. a class library which handles Active Directory communication

The class library for AD communication, which is called "Simple AD Browser Helpers.dll", has a reference to ADSI (http://msdn.microsoft.com/en-us/library/windows/desktop/aa772170%28v=vs.85%29.aspx).

The ADSI SDK is needed since we need the interfaces IADsPropertyList and IADsPropertyEntry for making sure that Active Directory types, which are unknown to the .NET Framework, are displayed properly.

If you are having trouble compiling the class library "Simple AD Browser Helpers.dll", because the reference "Interop.ActiveDs" or "ActiveDs" was not found, please do the following steps:

  1. Select "Solution Explorer" in Visual Studio
  2. Navigate to & expand the project "Simple AD Browser Helpers"
  3. Right click on references and choose "Add Reference..."
  4. Choose "Browse"
  5. Go to your Windows directory, e.g., C:\Windows\SysWOW64
  6. Select the file "activeds.tlb"
  7. Hit "OK"

Revisions

  • Initial release 02.02.2004
  • Code rework 05.01.2014 (cleaned up code and added class library for AD communication, added ADSI type conversions)

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here