Hi,
I need to read all LDAP PATH from a Domain in Active-Directory. The Problem is: There are more then 1000 PCs in the Domain and following doesn't work:
strLDAPQuery="<LDAP://xxx.de/dc=aa,dc=de>;(&(objectclass=organizationalUnit)(ou=*));adspath,name;subtree"
Set objCON = CreateObject("ADODB.Connection"
CONSTRING = "Provider=ADSDSOObject"
objCON.Open CONSTRING ' , "administrator", ""
set rs = objCon.Execute(cstr(strLDAPQuery))
i=0 'counter
If rs is nothing or rs.EOF Then MsgBox "no Objects found"
While Not rs.EOF
'msgbox rs("name"
& " " & rs("adspath"
& chr(10)
ou(counter) = rs("adspath"
counter= counter+1
rs.MoveNext
Wend
rs.Close
objCON.Close
I know, that the End of File will be after 1200 "loops"
but in the script is an exit after 1000 loops (counter=1000), I don´t know why....
if you have an idea, please contact directly by e-mail:
aaxi@aol.com
I need to read all LDAP PATH from a Domain in Active-Directory. The Problem is: There are more then 1000 PCs in the Domain and following doesn't work:
strLDAPQuery="<LDAP://xxx.de/dc=aa,dc=de>;(&(objectclass=organizationalUnit)(ou=*));adspath,name;subtree"
Set objCON = CreateObject("ADODB.Connection"

CONSTRING = "Provider=ADSDSOObject"
objCON.Open CONSTRING ' , "administrator", ""
set rs = objCon.Execute(cstr(strLDAPQuery))
i=0 'counter
If rs is nothing or rs.EOF Then MsgBox "no Objects found"
While Not rs.EOF
'msgbox rs("name"


ou(counter) = rs("adspath"

counter= counter+1
rs.MoveNext
Wend
rs.Close
objCON.Close
I know, that the End of File will be after 1200 "loops"
but in the script is an exit after 1000 loops (counter=1000), I don´t know why....
if you have an idea, please contact directly by e-mail:
aaxi@aol.com