by Bart Jonkman (20 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 19th February 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
ADSI sample showing how to list all domains in the namespace.
' This script lists all domains in the namespace
' Goto http://www.activxperts.com/activmonitor and click on ADSI Samples
' for more samples
Sub ListDomains()
Dim objNameSpace
Dim Domain
Set objNameSpace = GetObject("WinNT:")
For Each objDomain In objNameSpace
WScript.Echo "Name: " & objDomain.Name
Next
End Sub
' Main
ListDomains()
WScript.Echo( vbCrlf & "For more samples, goto http://www.activxperts.com/activmonitor and click" )
WScript.Echo( "on ADSI samples" )