powered by Jive Software

LDAP searchFilter causing multiple hits? (wf 2.5.1)

With no search filter, everything works just peachy and all is well. When I add this search filter however - (!(sAMAccountName=jabber_)) - my debug log prints the following:

2006.03.13 17:12:39 Trying to find a user’'s DN based on their username. sAMAccountName: username, Base DN: OU=organizational_unit,DC=mysite,DC=org…

2006.03.13 17:12:39 Creating a DirContext in LdapManager.getContext()…

2006.03.13 17:12:39 Created hashtable with context values, attempting to create context…

2006.03.13 17:12:40 … context created successfully, returning.

2006.03.13 17:12:40 Starting LDAP search…

2006.03.13 17:12:40 … search finished

2006.03.13 17:12:40 Search for userDN based on username ‘‘username’’ found multiple responses, throwing exception.

/code

The same message is given no matter what I make the search filter. I am trying to exclude security groups that start with ‘‘jabber_’’ from appearing in my list of users. Anyone have any ideas?

Message was edited by: mankyd

Message was edited by: mankyd

Let’'s say the username is “jsmith”. In that case, the search is:

(!(sAMAccountName=jabber_jsmith))

I’‘m assuming there’‘s a LOT of users that don’'t have the account name jabber_jsmith. You probably want to do something like:

(&(!(sAMAccountName=jabber_)) (sAMAccountName=))

(not sure if my LDAP syntax is correct).

Regards,

Matt

Matt,

Your syntax looks right to me.