I'm trying to do a fairly straightforward query and when I create a search
using my query string directly it works fine but when I pass in a filter
generated using the Filter.create* methods it returns nothing.
So as I've stated if I pass that as a string when creating a SearchRequest
then it correctly returns all computers that are not disabled. However,
when I generate the filter like this:
it returns nothing. The strange thing is that calling either toString() or
even toNormalizedString() returns the same string. However, when I call
the encode method on the generated str vs one created with
Filter.create(str) then the valueBytes are completely different! Can
somebody help me understand what's going on here?
~Adam~
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem is that "(userAccountControl:1.2.840.113556.1.4.803:=2)" is not an equality filter. It is an extensible match filter with an attribute type of "userAccountControl", a matching rule ID of "1.2.840.113556.1.4.803", and an assertion value of "2". Rather than using:
Hello,
I'm trying to do a fairly straightforward query and when I create a search
using my query string directly it works fine but when I pass in a filter
generated using the Filter.create* methods it returns nothing.
Here is the query I'm trying to generate:
(&(objectCategory=computer)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
So as I've stated if I pass that as a string when creating a SearchRequest
then it correctly returns all computers that are not disabled. However,
when I generate the filter like this:
Filter.createEqualityFilter("userAccountControl:1.2.840.113556.1.4.803:",
"2")))
it returns nothing. The strange thing is that calling either toString() or
even toNormalizedString() returns the same string. However, when I call
the encode method on the generated str vs one created with
Filter.create(str) then the valueBytes are completely different! Can
somebody help me understand what's going on here?
~Adam~
The problem is that "(userAccountControl:1.2.840.113556.1.4.803:=2)" is not an equality filter. It is an extensible match filter with an attribute type of "userAccountControl", a matching rule ID of "1.2.840.113556.1.4.803", and an assertion value of "2". Rather than using:
You should use:
Neil