How can I browse Active Directory

May 12 2010 3:30 PM

I have the following code to get the root off AD
But how can I browse the children of the root?
Imports System.DirectoryServices
Imports System.Windows.Forms
Imports System.Drawing.Printing
Imports ActiveDs
Public Class ExportAD
    Inherits System.Windows.Forms.Form
    Private deBase As DirectoryEntry
    Private Function DomainName() As String
        Dim objRootDSE As New DirectoryEntry("LDAP://RootDSE")
        DomainName = objRootDSE.Properties("defaultNamingContext")(0)
    End Function
    Private Sub ExportAD_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        deBase = New DirectoryEntry("LDAP://" & DomainName())
    End Sub