Display OU children (Visual Basic)
This code can be found in
Chapter 31 of Active Directory, 3rd Edition
Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.
Find out how to download all of the Visual Basic code from this site.
' From the book "Active Directory, Third Edition"
' ISBN: 0-596-10173-2
Sub Main()
Dim objADObject As New DirectoryEntry("LDAP://dc=mycorp,dc=com")
DisplayChildren(objADObject, " ")
End Sub
Sub DisplayChildren(ByVal objADObject As DirectoryEntry, _
ByVal strSpaces As String)
If objADObject.SchemaClassName = "organizationalUnit" Then
Console.WriteLine(strSpaces & objADObject.Name)
End If
Dim objChild As New DirectoryEntry()
For Each objChild In objADObject.Children
DisplayChildren(objChild, strSpaces & " ")
Next objChild
End Sub
|
This code has been viewed 1784 times.
|
New from the creators of TechTasks.com:
StatSheet.com
|