I found I could not search for substrings of AdsPath or
DistinguishedName. I don't think AdsPath can be searched
at all. However, wouldn't the fasted search be simply
(note, I added another * in the string):
strFilter = "(|(cn=*" & strSearchMe & "*)
(sAMaccountname=*" & strSearchMe & "*))"
You still search the same number of objects either way,
but less work is done checking each. Or am I wrong in
this? The only downside is that you might return some
groups - I'm assuming you aren't sure of the name.
>Problem: To speed up searches through many OU's I want to
>cn's in ou's named "users" in the tree.
>But the following filter doesn't work:
>strFilter = "(&(objectClass=User)
> (|(cn=*" & strSearchMe & "*)
> (sAMaccountname=" & strSearchMe & "*)))"
>Is it not possible to use adspath or parent in filter
>Thanks for any help,