Module Module1
Sub Main()
Dim forest, child
forest = GetObject("GC://DC=ForestName,DC=Company,DC=COM") 'Path to
forest
For Each child In forest
If Not child.DC = "" Then ' if child.DC is not empty, then it
is a Domain
Console.WriteLine(child.DC) 'print the domain name
End If
Next
End Sub
End Module
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.