LDAP Query search order

G

Guest

When I perform an LDAP query of user objects in an OU, it always searches in
the same order. It does not do this alphabetically by user name, or by create
date, or USN number. What criteria does it use to search, and how can I enter
that in my LDAP query? The reason that I ask is that it would be nice to pick
up where a script left off without having to start over.
Thanks!
 
B

Brandon McCombs

Robertsaccount said:
When I perform an LDAP query of user objects in an OU, it always searches in
the same order. It does not do this alphabetically by user name, or by create
date, or USN number. What criteria does it use to search, and how can I enter
that in my LDAP query? The reason that I ask is that it would be nice to pick
up where a script left off without having to start over.
Thanks!

There is no "order". It returns entries in the order they were added to the OU.
That is LDAP and not an ADS thing.
 
J

Joe Richards [MVP]

It depends entirely on the query and what indexes are chosen by the QP to run
the query in the most efficient way and can never be relied on because it could
change between implementations. The only way to guarantee any kind of return
order is to submit a server side search control for a sortable attribute. I do
not believe you can do this with ADSI scripts, you would need to use a tool (or
write your own) that can submit a server side sort such as adfind.

http://www.joeware.net/win/free/tools/adfind.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top