Searching Active Directory with ADSI and VBScript

You may also like...

4 Responses

  1. Gary says:

    Rather than explicitly referencing your domain root, you can use the following:

    Set objRootDSE = GetObject(“LDAP://RootDSE”)
    ADSRoot = objRootDSE.Get(“rootDomainNamingContext”)

  2. Lewis says:

    Thanks Gary, I remember writing this as I was still exploring VBScript and you’re absolutely right, that would make the script instantly portable to other domains.

  3. sai gandhi says:

    Awesome script….

  4. Suhdir says:

    important script……!


Discover more from

Subscribe now to keep reading and get access to the full archive.

Continue reading