Dave King
8/26/2007 5:35:00 AM
What I really wanted to do was this
(&(samaccounttype=805306368)(|(lastLogonTimestamp<=128231111837280000)(&(!(lastLogonTimestamp=*))(whenCreated<=
20070522000000.0Z))))
and that works.
Thanks
Francis Cianfrocca wrote:
> On 8/22/07, dave@davewking.com <dave@davewking.com> wrote:
>
>>
>> So it looks like my problems may be bigger than undefined constants. I've
>> also been looking at Net::LDAP as well, the only problem I've found there
>> is that it doesn't parse my ldap filters right so I have to rewrite them
>> in the Net::LDAP way. For example this filter works fine in ruby-ldap
>>
>> (&(samaccounttype=805306368)(|(lastLogonTimestamp<=128231111837280000)(&(!(lastLogonTimestamp=*)(whenCreated<=
>> 20070522000000.0Z)))))
>>
>> but in Net::LDAP it gives me this error
>>
>> c:/ruby/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4
>> /lib/net/ldap/filter.rb:302:in
>> `initialize': invalid filter syntax (Net::LDAP::LdapError)
>>
>> when i run it like this
>>
>> filter =
>> Net::LDAP::Filter.construct
>> ("(&(samaccounttype=805306368)(|(lastLogonTimestamp<=128231111837280000)(&(!(lastLogonTimestamp=*)(whenCreated<=
>> 20070522000000.0Z)))))")
>>
>> I can rewrite my stuff to use the Net::LDAP filters, but it would be nice
>> to just use the ldap filter string.
>>
>>
>>
>>
>>
>
> I can help you debug this. The only thing I can see offhand that is weird is
> the Zulu timestring. You can help me by taking each of the individual
> branches in your filter, without the &s and the !, and just run them one by
> one through Net::LDAP::Filter.construct till you find the one that breaks.
>
>