Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with reading LDAP with vbscript

Status
Not open for further replies.

axi67

Technical User
Joined
Nov 3, 2002
Messages
1
Location
GB
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=&quot;<LDAP://xxx.de/dc=aa,dc=de>;(&(objectclass=organizationalUnit)(ou=*));adspath,name;subtree&quot;
Set objCON = CreateObject(&quot;ADODB.Connection&quot;)
CONSTRING = &quot;Provider=ADSDSOObject&quot;
objCON.Open CONSTRING ' , &quot;administrator&quot;, &quot;&quot;
set rs = objCon.Execute(cstr(strLDAPQuery))
i=0 'counter
If rs is nothing or rs.EOF Then MsgBox &quot;no Objects found&quot;
While Not rs.EOF
'msgbox rs(&quot;name&quot;) & &quot; &quot; & rs(&quot;adspath&quot;) & chr(10)
ou(counter) = rs(&quot;adspath&quot;)

counter= counter+1
rs.MoveNext
Wend
rs.Close
objCON.Close

I know, that the End of File will be after 1200 &quot;loops&quot;
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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top