Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » VBScript » Custom script

List All ADAM OUs

You can use any of the VBScript programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.

Example(s)

On Error Resume Next

Set objDomain = GetObject("LDAP://localhost:389/dc=fabrikam,dc=com")
objDomain.Filter = Array("organizationalUnit")

For Each objOU in objDomain
    strNames = strNames & objOU.Name & vbcrlf
    ShowOUS objOU.AdsPath
Next

Sub ShowOUs(OUName)
    Set objNextOU = GetObject(OUname)
    objNextOU.Filter = Array("organizationalUnit")
    For Each objSubOU in objNextOU
        strNames = strNames & "     " & objSubOU.Name & vbcrlf
        ShowOUS objSubOU.AdsPath
    Next
End Sub

Wscript.Echo strNames