Results 1 to 3 of 3

Thread: new uniqueMember in Ldap group

  1. #1
    Join Date
    Jan 2005
    Posts
    5

    Default 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. #2
    Join Date
    Mar 2005
    Location
    Landskrona, Sweden
    Posts
    505

    Default

    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);
    Mattias Arthursson
    Jayway AB (www.jayway.se)
    Spring-LDAP project member

  3. #3
    Join Date
    Jan 2005
    Posts
    5

    Default

    Thanks a lot. It works fine now.

    Soby

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •