Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: James Hunt
Unimplemented Filters [ reply ]  
2006-12-20 14:56
I was trying to perform a search on Active Directory Users (my AD library utilizes Net::LDAP as a base), for accounts that are locked out due to bad authentication attempts. The attribute in the AD LDAP store that has this information is lockoutTime - if it is 0 (or not present) then the account is not locked out.

My initial attempt was to use the Net::LDAP::Filter.ne method (which I am assuming means 'Not Equal'), but the following code fails:

ldap.find(:filter => Net::LDAP::Filter.ne('lockoutTime','0'))

Net::LDAP itself raises a Runtime Exception about the filter being unimplemented. I traced it back through the code, and found that the to_ber method does not have a branch in its case statement to cover the :ne situation that the Net::LDAP::Filter.ne method creates.

Is Net::LDAP::Filter.ne no longer implemented?

Thanks,
James