470,641 Members | 1,674 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,641 developers. It's quick & easy.

vb.net & adsi responses > 1000

I'm new to VB.NET and ADSI. By default it appears the adsi limits objects
returned to 1000 items. I've seen web references that say that the limit is
imposed by unpaged queries. I added an explicit pagesize statement, and the
findall.count value went up from 1000 to 4000+ for the OU that I'm querying.
(with considerable added delay in response). However when I try to iterate
through a for-each loop, I still seem to get only 1000 items. Subsequent
"get" statements return the same first 1000 items. I know that I'm doing
something ignorant, but I don't know how to get beyond the first 1000 items
returned. Looking for a vb example that could get me past this. For my
purposes in this item, I really do need to return all the objects in the OU
and I know that there are more than 4000 user objects in this OU. My code
looks something like the following:

ldapquerystring = "LDAP://" & DistName

ds.SearchRoot = New DirectoryEntry(ldapquerystring)
ds.PageSize = 1000

Dim dsResult As DirectoryServices.SearchResult

i1 = ds.FindAll.Count
iterations = i1 / 1000

For iterCount = 1 To iterations
objContainer = GetObject(ldapquerystring)
For Each objUser In objContainer
i1 = 0 'reset the test value
strName = objUser.Name
i1 = strName.Length
If i1 > 0 Then
strDesc = objUser.Description
userFN = objUser.Get("givenName")
userSN = objUser.Get("sn")
userDesc = objUser.Get("description")
userCAI = objUser.Get("cvx-cai")
userBillCAI = objUser.Get("cvx-BillingCAI")
userDispN = objUser.Get("displayName")
outline = strName & "%" & userFN & "%" & userSN & "%" &
userDesc & "%" & userCAI & "%" & userBillCAI & "%" & userDispN & "%" &
DistName
WriteIt(outline)
End If
Next 'ObjUser
objContainer = GetObject(ldapquerystring)
Next 'Itercount

--
Rick
Nov 21 '05 #1
0 1057

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

39 posts views Thread by Hareth | last post: by
7 posts views Thread by John Nagle | last post: by
1 post views Thread by zmunoz | last post: by
5 posts views Thread by mdh | last post: by
1 post views Thread by Korara | last post: by
???
1 post views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.