Re: AD queries - wildcard with only one character



objectClass generally isn't indexed (unless you changed that in your
directory), so it is a good idea to avoid it in a query if you can unless
the performance of the query is not important to you. objectCategory is
indexed and single-valued and performs much better for this type of thing.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Gregor" <Gregor@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B5B33126-B8A7-4879-811D-669441332049@xxxxxxxxxxxxxxxx
Thank you very much for your quick answer.

I already use objectclass as I exclude all disabled computers in my query.
As you mentioned I will add a new condition for each location in my query.

Thank you again.

With kind regards,

Gregor

"Joe Kaplan" wrote:

There is no such LDAP filter. There are just exact matches and substring
matches (or >= and <=, although I don't think that's helpful in this
context). The best you could do would be:

*LE*

Unfortunately, that would be wickedly slow (medial searches like that
don't
execute against an index unless there is a special "tuple" index built
for
the attribute, and that isn't standard), and might yield some false
positives as well. If there aren't too many locations, then you could
create a big "OR" query:

(|(CN=CHILE*)(CN=NYCLE*)(CN=INDLE*))

Or something like that. I would expect that to be much faster. Adding
in a
condition to filter on objectCategory is probably a good idea too:

(&(objectCategory=computer)(|(CN=CHILE*)(CN=NYCLE*)(CN=INDLE*)))

Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services
Programming"
http://www.directoryprogramming.net
--
"Gregor" <Gregor@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3128C449-7565-480F-A170-96ED56CBE329@xxxxxxxxxxxxxxxx
Our computer name contains 10 characters. The first 3 contain the
location
name. The next 7 characters contain the serial number of the computer.
For
example: CHILE3KS45.
I would like to create a query (AD Users & Computers) to find our
entire
notebooks in all locations. I know that the notebook serial number
begins
with LE. Unfortunately, I am unable to find the syntax for the first 3
characters that should be a wildcard (as I am searching for all
locations). I
tried: ___ ??? %%% . Anyone an idea?






.



Relevant Pages

  • Re: Urgent: Restrict LDAP Queries of a domain user
    ... The way I read your question was from a strictly LDAP sense. ... query, they can do a one-level or base level query as well. ... Joe Kaplan-MS MVP Directory Services Programming ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ...
    (microsoft.public.windows.server.active_directory)
  • Re: Adding msDS-BindableObject to an existing objectclass
    ... Joe Kaplan-MS MVP Directory Services Programming ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... Your defuncting and re-adding of the objectClass with the same ... the problem objectclass and then recreate it (which it said ...
    (microsoft.public.windows.server.active_directory)
  • Re: Adding msDS-BindableObject to an existing objectclass
    ... Can you explain what you mean by the passwords? ... Joe Kaplan-MS MVP Directory Services Programming ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... objectclass and then recreate it properly without having to recreate the ...
    (microsoft.public.windows.server.active_directory)
  • Re: ADAM
    ... ADAMSync is in the ADAM install directory and the documentation for it ... Joe Kaplan-MS MVP Directory Services Programming ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... application to query adam When it need to query users in my two ADs ...
    (microsoft.public.windows.server.active_directory)
  • Re: Is there a limit to number record returned from AD serach to a
    ... a great deal more "clunky" than using the DirectorySearcher. ... Joe Kaplan-MS MVP Directory Services Programming ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... query select statement in C# to fill table in a dataset. ...
    (microsoft.public.dotnet.security)

Loading