Querying Active Directory using VBScript
To look at all the members of an OU, try this… Set objOU = GetObject(“LDAP://OU=YourOU,DC=YourDomain,DC=com”) For each objMember in ObjOU ‘ get all the members’ ‘ do something’ Next To do a custom search for DNs try this… set conn = createobject(“ADODB.Connection”) Set iAdRootDSE = GetObject(“LDAP://RootDSE”) strDefaultNamingContext = iAdRootDSE.Get(“defaultNamingContext”) Conn.Provider = “ADsDSOObject” Conn.Open “ADs Provider” … Read more