• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Add user to ldap groups!!

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to ldap. How do I add a user to a particular group in ldap? I am using IBM ldap and my admin had created several groups to which I need to add users programatically. Can any one tell me how to do this?
Thanks!
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have access to the SecureWay client? If not, you will need access to either this or another LDAP client. You could do it using JNDI, but the client is generally easier.
You also need to know the name of the LDAP role and the DN (ie full distinctive name) of the person you want to add to the role.
Connect to the client, find the role, add the entry.
If you don't have the full DN for the role, you can seach using cn=name_of_role and still able to add the user. You can find the DN of the user in the same way.
This is sometimes confusing, since you add users to the role entry, rather than adding the role entry to the user. But that's the way it works.
Hope this helps.
Dave.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops, my bad, I missed the past "add users programatically".
The code I use is listed below

Note that the group type we use is objecttype=groupofnames, which stores users as "member" (see the ModificationItem). If you use a different objecttype you will need to add the correct attribute.
For no extra cost, here is the remove code:

Dave
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic