Re: AD queries - wildcard with only one character

Tech-Archive recommends: Fix windows errors by optimizing your registry



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?



.