473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1141

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: James Allan | last post by:
Hello -- I'm trying to get SQL Server 2000 on a Windows 2000 Server to be able to query an Active Directory. We've got two domain servers one Win2000 and one Win2003. However, I'm having...
2
by: vorpal | last post by:
Hi, I have successfully set and used a linked server to query ADSI. Since this question also concerns MSSQLServer, I've cross posted it -- I hope this is not a breach of etiquette. I have...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
39
by: Hareth | last post by:
C# 2005 express & vb 2005 express: 1. During runtime, I can edit my codes in C#..... How come this cannot be done in VB? it says ...."read-only" during runtime...... 2. Why does vb...
1
by: citnamor | last post by:
Hello, I'm trying to access a webservice which runs on our SOAP Server (Apache Tomcat) with Windows 2000 Advanced Server. I simply added the webreference local copy of wsdl file into dotNet...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
7
by: John Nagle | last post by:
I've been parsing existing HTML with BeautifulSoup, and occasionally hit content which has something like "Design & Advertising", that is, an "&" instead of an "&amp;". Is there some way I can get...
1
by: zmunoz | last post by:
I am working on a script using ADSI via COM in PHP. The script works for the most part when I query a user using the following function: function passwordExpires($userDN) { $comLDAP = new...
5
by: mdh | last post by:
Hi All, I have a couple of questions regarding the discussions on page 124 of k&r. 1) This references functions working with complicated declarations in C. before main(...,...){}, (in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.