B
BDRR82
This code works, but I'm totally new to Active Directory, so the code didn't
do what I expected/wanted.
What I want is to walk the Active Directory on a Small Business Server 2000
box, writing out each Organizational-Unit, User, Group, Distribution List,
and Contact.
Of course I can see with eyeballs all the Organizational-Units, Users,
Groups, Distribution Lists, and Contacts using the SBS2000 Administration
Console app.
And the Code below does get 2 of the 5 categories I need: it gets Users and
Groups.
But can anyone clue me in, point to sample code, etc, on how to get
DirectoryServices (or some other facility?) to cough up the
Organizational-Units, Distribution Lists, and Contacts?
thanks!
Dim sPath As String = "WinNT://SMALLBUSINESS.local"
FileOpen(3, "C:\enum.txt", OpenMode.Output)
Dim deDomain As DirectoryEntry = New DirectoryEntry(sPath,
"SMALLBUSINESS\Administrator", "NoShowInPost")
Dim deThings As DirectoryEntries = deDomain.Children
PrintLine(3, "Things-----")
For Each deThing As DirectoryEntry In deThings
PrintLine(3, deThing.Name & ", " & deThing.SchemaClassName)
PrintLine(3, " Children-----")
Dim deThingChildren As DirectoryEntries = deThing.Children
For Each deThingChild As DirectoryEntry In deThingChildren
PrintLine(3, " " & deThingChild.Name & ", " &
deThingChild.SchemaClassName)
Next deThingChild
Next deThing
FileClose(3)
---- end post ----
do what I expected/wanted.
What I want is to walk the Active Directory on a Small Business Server 2000
box, writing out each Organizational-Unit, User, Group, Distribution List,
and Contact.
Of course I can see with eyeballs all the Organizational-Units, Users,
Groups, Distribution Lists, and Contacts using the SBS2000 Administration
Console app.
And the Code below does get 2 of the 5 categories I need: it gets Users and
Groups.
But can anyone clue me in, point to sample code, etc, on how to get
DirectoryServices (or some other facility?) to cough up the
Organizational-Units, Distribution Lists, and Contacts?
thanks!
Dim sPath As String = "WinNT://SMALLBUSINESS.local"
FileOpen(3, "C:\enum.txt", OpenMode.Output)
Dim deDomain As DirectoryEntry = New DirectoryEntry(sPath,
"SMALLBUSINESS\Administrator", "NoShowInPost")
Dim deThings As DirectoryEntries = deDomain.Children
PrintLine(3, "Things-----")
For Each deThing As DirectoryEntry In deThings
PrintLine(3, deThing.Name & ", " & deThing.SchemaClassName)
PrintLine(3, " Children-----")
Dim deThingChildren As DirectoryEntries = deThing.Children
For Each deThingChild As DirectoryEntry In deThingChildren
PrintLine(3, " " & deThingChild.Name & ", " &
deThingChild.SchemaClassName)
Next deThingChild
Next deThing
FileClose(3)
---- end post ----