Announcement Announcement Module
Collapse
No announcement yet.
new uniqueMember in Ldap group Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • new uniqueMember in Ldap group

    Hi all,

    I am trying to add a new entry in my existing ldap group (a new uniqueMember). However, when I am trying to add a new uniqueMember through ldapTemplate, I am not able to do that. It complains that this attribute already exists. Can anyone please explain how I can do that through ldapTemplate? Below is what I used to create my initial members:

    dn: cn=poweruser,ou=groups,dc=ui,dc=mydomain,dc=com
    objectClass: groupOfUniqueNames
    cn: poweruser
    uniqueMember: uid=user1,ou=users,dc=ui,dc=mydomain,dc=com
    uniqueMember: uid=user2,ou=users,dc=ui,dc=mydomain,dc=com

    and I am trying to simply add a new uniqueMember through LdapTemplate.
    I will greatly appreciate if anybody can help...

    Thank you,
    Soby Chacko

  • #2
    You should be able to use the modifyAttributes method, e.g.:
    Code:
    ModificationItem[] mods = new ModificationItem[1];
    mods[0] = new ModificationItem(DirContext.ADD_ATTRIBUTE, new BasicAttribute("uniqueMember", <dn to add>));
    ldapTemplate.modifyAttributes("cn=poweruser,ou=groups,dc=ui,dc=mydomain,dc=com",mods);

    Comment


    • #3
      Thanks a lot. It works fine now.

      Soby

      Comment

      Working...
      X