I am using ruby's net/ldap library for this problem but in reality the driver language shouldn't really matter. I need to find a way to be able to get all the users from a system and find out which users do not have emails assigned to the account. Is it possible?
I can connect to and even create new records through LDAP, and can return queries by using wildcard entries to filter results.
given i create a filter to find the cn that begins with three 9's:
filter = Net::LDAP::Filter.eq("cn", "999*")
@connection.search(:base => "cn=Manager, dc=foo, dc=bar, dc=biz",
:filter => filter)
then my result count might be 42.
given i create the same filter but request only 1 nine, the query fails and returns false
filter = Net::LDAP::Filter.eq("cn", "9*")
@connection.search(:base => "cn=Manager, dc=foo, dc=bar, dc=biz",
:filter => filter)
and this is the same if I request just "cn", "*"
which to me should say "give me all the cn's out there.
".