473,385 Members | 1,876 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,385 software developers and data experts.

VB.NET: DirectoryServices Member.Count limit of 1000

The System.directoryservices.dll has an error, and this error was described
in http://support.microsoft.com/default...b;en-us;839424

At the moment we have Framework version v1.0.3705 and I have remove
System.directoryservices.dll from current Framework version v1.0.3705. In
state of old version I load die new System.directoryservices.dll from the
Framework version v1.1.4322.

I work with the following function of Joe Kaplan \(MVP - ADSI ) 8 Jan. In
2004 uses 22:59 (see below). But if I have more than 1000 Members, I receive
this error:

_COMPlusExceptionCode:-532459699
_message: "In operations error occurred."
_HResult:-2147016672
_xcode:-532459699
StackTrace:"at System . DirectoryServices . Interop . IAds . GetInfoEx
(Object vProperties, Int32 lnReserved) at System . DirectoryServices .
DirectoryEntry . RefreshCache (String [] propertyNames) at SWDIS.MainSWDis .
GetAllAttributeValues (DirectoryEntry entry, String attributeName) in
C:\Develop\TestAD\MainTestAD.vb:line 679"

I has reduced Increment from 1000 to 500 and has ignored code line

....If attributeValues.Count < 1000 Then...

,till 999 (1000) I receive all Members. By 3-rd loop (the range string was
"member;range=1000-1499") I get this error by the function entry.RefreshCache
(New string () {currentRange})!

The version of system.EnterpriseServices.dll is 1.1.4322.2032 88.0 KB
(90'112 bytes). And old version of system.EnterpriseServices.dll was
1.0.3705.6018 84.0 KB (86'016 bytes).

Can somebody help?

VB.NET Code from Joe Kaplan \(MVP - ADSI ) 8 Jan. In 2004 uses 22:59
################################################## ##########
Protected Shared Function GetAllAttributeValues(ByVal entry As
DirectoryEntry, ByVal attributeName As String) As ArrayList

Dim propValues As PropertyValueCollection
Dim propValue As Object
Dim attributeValues As PropertyValueCollection
Dim values As ArrayList
Dim currentRange As String
Dim startCount As Integer
Dim endCount As Integer
Dim iteration As Integer
Dim increment As Integer = 500 '1000
Dim expectedErrorCode As Integer = -2147016672
'This optimization reads the attributey directly if it
'contains less than 1000 values and returns an arraylist based
'on that. If we have 1000 values, we assume that there are likely
more than
'1000 values and we resort to the slower attribute ranging method()
'done below
entry.RefreshCache(New String() {attributeName})
attributeValues = entry.Properties(attributeName)
If attributeValues.Count < 1000 Then
Dim memberValue As Object
values = New ArrayList(attributeValues.Count)
For Each memberValue In attributeValues
values.Add(memberValue)
Next
values.TrimToSize()
Return values
End If
'here we go into ranging mode
values = New ArrayList(1000)
Do
startCount = iteration * increment
endCount = (iteration + 1) * increment - 1
'This is the attribute ranging method for retrieving the
contents of large attributes
currentRange = String.Format("{0};Range={1}-{2}", attributeName,
startCount, endCount)
currentRange = String.Format("member;range={0}-{1}", startCount,
endCount)
'this will throw when the lower bound on the range is too high()
Try
entry.RefreshCache(New String() {currentRange})
Catch e As Exception 'I might check for the expected hresult,
but I don't know if I need to
Exit Do
End Try
'Get the values for for the current range of attributes
propValues = entry.Properties(attributeName)
For Each propValue In propValues
values.Add(propValue)
Next
iteration += 1
values.Capacity += increment
Loop
values.TrimToSize()
Return values
End Function
################################################## ##########

Thanks and Best regards

Aug 25 '05 #1
0 2109

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

Similar topics

47
by: Mountain Bikn' Guy | last post by:
Take some standard code such as shown below. It simply loops to add up a series of terms and it produces the correct result. // sum numbers with a loop public int DoSumLooping(int iterations) {...
9
by: Terry E Dow | last post by:
Howdy, I am having trouble with the objectCategory=group member.Count attribute. I get one of three counts, a number between 1-999, no member (does not contain member property), or 0. Using...
9
by: Patrick | last post by:
I have an ASP.NET page that searches for someone in the corporate Active Directory. It had been working fine until recently when I changed from Basic Authentication on IIS6 back to Integrated...
0
by: rias | last post by:
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...
0
by: kovac | last post by:
The System.directoryservices.dll has an error, and this error was described in http://support.microsoft.com/default.aspx?scid=kb;en-us;839424 At the moment we have Framework version v1.0.3705 and...
6
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
3
by: Sambo | last post by:
By accident I assigned int to a class member 'count' which was initialized to (empty) string and had no error till I tried to use it as string, obviously. Why was there no error on assignment( near...
0
by: shamirza | last post by:
· When was .NET announced? Bill Gates delivered a keynote at Forum 2000, held June 22, 2000, outlining the .NET 'vision'. The July 2000 PDC had a number of sessions on .NET technology, and...
0
by: msconfused | last post by:
Hello all. I'm hoping that someone can help me solve this error. This is the error that I am getting. Fatal error: Call to a member function on a non-object in /home/paytoo/public_html/prices.php...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.