Active Directory paging problem

  • Thread starter Thread starter cameron
  • Start date Start date
C

cameron

I have a COM object, (implemented in C#), that has a method to return a
directory entry. This directory entry is a Group object which has a
members attribute which contains 1500+ entries. I can only get the first
1000 when I am looping through them in ASP. I have found a few postings
about 'Page Size' being set to 1000 in AD, but you can not set Page Size
on a directory entry, only a Directory Searcher. If I am doing basically
the same deal in aspx code, (no COM funk in there), it behaves as
expected and I can loop through all of the members. Does anyone have a
solution/know how to enable paging on a directory entry object?

-Cam
 
Hi Cam

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Hi Cam,

Thank you for posting in the community!

Based on my understanding, you meet the problem of using ADSI in asp to get
the directory entries more than 1000.

============================
Actually, just as you said, this is a limitation of Active Directory. The
default limit value is 1000.

To workaround this issue, you need to do the search with Paging(the default
is no paging), for more information, please refer to:
"Retrieving Large Results Sets"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/r
etrieving_large_results_sets.asp

"Paging with IDirectorySearch"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/p
aging_with_idirectorysearch.asp

Also, you may workaround this issue through .Net
System.DirectoryServices.DirectorySearcher class, which will have no this
limitation. For more information, please refer to:
"Using System.DirectoryServices to Search the Active Directory"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/ht
ml/dotnetadsearch.asp

BTW, in the future, it would be best to post these questions in the
following newsgroup:
Microsoft.public.adsi

The reason why we recommend posting appropriately is you will get the most
qualified pool of respondents, and other partners who the newsgroups
regularly can either share their knowledge or learn from your interaction
with us. Also, this is to make sure that the responders can better track
the problem Thank you for your understanding!

============================
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
I had looked at these before posting. They are all about doing searches
and paging. I have an object in AD. I know its DN in advance and it will
never change. I do not need to search for it. I just want to loop
through the list that is its members, (it is a group object). I retrieve
the object and it will only give me the first 1000 members of this
group. I know that I could do a search for users that are a memberOf
this group but since there are so many users and the users can exist in
multiple containers at multiple different levels this would be a very
expensive search which I would like to avoid. I know that aspx does not
have this issue but retro-fitting an existing application on multiple
production environments to point to a different page would not be as
happy as fixing the asp page.

-Cam
 
Hi Cam,

Thanks very much for your feedback.

As you can see, this limitation is by the design of AD, and I think Paging
is the only recommended way.

I think you want to display the query result in your ASP page, yes? If so,
I think it is not effective to query and return such a large result set.

Actually, in the 2 articles in my original reply, it shows you a lot of
performance advantage of using Paging to query AD. And the Paging query is
the recommanded way to do query for AD.

Can you tell me how you will use your queried result set? Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
So you are saying that I have to do a query instead of looping through
the attributes of a single object.

Thanks.

-Cam
 
Hi Cam,

I am not understand your feedback. Can you explain it more clear to me?
Does my original reply explain my point clear to you?

Please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
As the original post said, I have a directoryEntry object. I am looping
through the Members attribute of that object. This attribute contains
1500 users, it only return 1000, (limition of AD as you have said). At
no point have I done a query. The location of this object is fixed and
it is known. You keep going on about paging and all of the links you
have sent only deal with paging when using directorysearcher or working
in aspx, which obviously does not apply since i am not doing a query and
I am in ASP. I do not have a result set. You can not enable paging on a
single DirectoryEntry object. Therefore I will have to do an incredably
expensive query instead of looping through the attributes of a single
object.

I was just summarizing.

-Cam
 
Hi Cameron,

Oh, thanks for re-explain to me.

Ok, yes, I understand your point. Yes, if you really do not want to use
Asp.net to workaround it. The only workaround in ASP is using Paging
search, althrough there are a lots of users and the users may belong to
mult-groups. Because this is a limitation of ADSI in COM.

If you still have any concern, please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi Cameron,

Do you still have any concern?

Please feel free to tell me. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top