Question & Answer
Question
How to add ldap user(s) into ldap static groups using LDIF file and command line method?
Answer
This is an example of how to add ldap user(s) into LDAP static groups using LDIF file and command line method:
A. Add new members to existing static group(s) in database:
---------------------------------------------------------------------------
1. Check for existing groups and their members, for example:
idsldapsearch -p 2389 -D cn=root -w secret -b cn=TestGroup,ou=Houston,o=IBM,c=US objectclass=*
>> cn=TestGroup,ou=Houston,o=IBM,c=US
objectclass=top
objectclass=groupofnames
cn=TestGroup
member=cn=Bob Garcia,ou=Austin,o=IBM,c=US
member=uid=user20,ou=Houston,o=ibm,c=us
or
idsldapsearch -p 2389 -D cn=root -w secret -b cn=SupportGroup,ou=Houston,o=IBM,c=US objectclass=*
>> cn=SupportGroup,ou=Houston,o=ibm,c=us
objectClass: top
objectClass: groupofuniquenames
cn: SupportGroup
uniqueMember:cn=James Campbell,ou=Widget Division,ou=Austin,o=IBM,c=US
uniqueMember:uid=user3,ou=Houston,o=ibm,c=us
2. To add new users into these existing groups:
A. Create an LDIF file called: add-1.ldif
dn:cn=TestGroup,ou=Houston,o=IBM,c=US
changetype: modify
add: member
member: cn=Kyle Nguyen,ou=Austin,o=IBM,c=US
member: uid=user1,ou=Dallas,o=ibm,c=us
dn: cn=SupportGroup,ou=Houston,o=ibm,c=us
changetype: modify
add: uniquemember
uniquemember: uid=user23,ou=Houston,o=ibm,c=us
uniquemember: uid=user33,ou=Dallas,o=ibm,c=us
3. Run idsldapmodify to add new users into the groups, for example:
idsldapmodify -p 2389 -D cn=root -w pw -f add-1.ldif
B. To add new groups along with members into database:
-----------------------------------------------------------------
1. Create an LDIF file to contain new groups and their members called: add-2.ldif
dn: cn=Techgroup,ou=Houston,o=IBM,c=US
objectclass: top
objectclass: groupofnames
cn: Techgroup
member: cn=David Campbell,ou=Austin,o=IBM, c=US
member: cn=Michael Campbell,ou=Austin, o=IBM, c=US
member: uid=user19,ou=Dallas,o=ibm,c=us
member: uid=user20,ou=Houston,o=ibm,c=us
dn: cn=Salegroup,ou=Houston,o=IBM,c=US
objectClass: top
objectClass: groupofuniquenames
cn: Salegroup
uniqueMember: uid=user12,ou=Dallas,o=ibm,c=us
uniqueMember: cn=Robert Dean,ou=Austin, o=IBM, c=US
uniqueMember: uid=user43,ou=Houston,o=ibm,c=us
2. Run idsldapadd, for example:
idsldapadd -p 2389 -D cn=root -w pw -f add-2.ldif
[{"Product":{"code":"SSVJJU","label":"IBM Security Directory Server"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"6.0;6.1;6.2;6.3;6.3.1;6.4","Edition":"","Line of Business":{"code":"LOB24","label":"Security Software"}}]
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21585947