Discussion:
Unable to pass the dynamic values in LDAP Search Filter
(too old to reply)
Bhavaniprasad Lagudu
2017-10-10 04:19:18 UTC
Permalink
Hi Guys,

I am new to TDI and i am trying to search group members of bulk ldap groups. I followed the below approach to complete the task.

1) Feed - From file connector read each groupDN from text file in itrater mode.
2) Data Flow -
- taken an attribute map to split the work.groupDN into 2 pieces
successfully.
ex: GroupDN: cn=laptopusers,ou=groups,dc=example,dc=com
Once split -
groupcn: cn=laptopusers
base: ou=groups,dc=example,dc=com
- After that i have taken LDAP Connector to read the members of each
groupcn with the relevant base.
connection tab i want to specify the groupcn and base for every
iteration
dynamically which I am unable to it.
searchFilter: '(&(objectclass=groupofnames)(cn='+groupcn+'))'
searchBase: {base}
i am not getting the valid results while using expressions also.
{base}

I see some posts on using link criteria in the scenario. But it is in lookup mode. But i want to do this in iterator mode. Please let me know is there any possible ways.

Thanks
yn2000
2017-10-10 15:38:53 UTC
Permalink
Second eyes responding:
groupcn: cn=laptopusers
searchFilter: '(&(objectclass=groupofnames)(cn='+groupcn+'))'
So the outcome is:
searchFilter: '(&(objectclass=groupofnames)(cn=cn=laptopusers))'
So, it is double 'cn='?
Rgds. YN
Bhavaniprasad Lagudu
2017-10-10 15:45:37 UTC
Permalink
Post by Bhavaniprasad Lagudu
groupcn: cn=laptopusers
searchFilter: '(&(objectclass=groupofnames)(cn='+groupcn+'))'
searchFilter: '(&(objectclass=groupofnames)(cn=cn=laptopusers))'
So, it is double 'cn='?
Rgds. YN
Agreed. if i use '(&(objectclass=groupofnames)('+groupcn+'))' would that work?
yn2000
2017-10-10 15:57:44 UTC
Permalink
Well, it will not work if you just using a plain LDAP connector.
You have to configure the LDAP connector using the Connector Loop (FOR-EACH: ConnectorLoop), inherited from LDAP Group Members Connector, and that search filter go to ldapSearchFilter (a Connector Parameter).

Rgds. YN.
Eddie Hartman
2017-10-10 19:36:38 UTC
Permalink
Post by yn2000
Well, it will not work if you just using a plain LDAP connector.
You have to configure the LDAP connector using the Connector Loop (FOR-EACH: ConnectorLoop), inherited from LDAP Group Members Connector, and that search filter go to ldapSearchFilter (a Connector Parameter).
Rgds. YN.
You can search groups like this in order to get back members, but note that AD has a limit on how many values for the member attribute it returns. No prob if you expect less than 1,500, otherwise you have to implement multiple calls with paging. Or use the recommended LDAP Group Members Connector, which also handles nested groups.

But if you are just looking to split up the DN into two parts, use javax.naming.ldap.LdapName:
----
url = "cn=laptopusers,ou=groups,dc=example,dc=com";
ldapName = new javax.naming.ldap.LdapName(url);
rdns = ldapName.getRdns(); // splits up the DN
groupdn = rdns.get(rdns.size()-1).toString(); // get most significant type and value
ldapName.remove(rdns.size()-1); // remove it
base = ldapName.toString(); // rest is the base
----
Forgive me if I'm misreading your question, Bhavaniprasad.

Loading...