Asked by:
openldap group user management fails - memeberof attribute undefined

Question
-
User-389237965 posted
Hi all, I am strugling to add users to a group i have created in my openldap server. users listed under ou=users,dc=.... and i have created ou call groups and sub group under groups call testusers then i have created new user cal test11 and trying to add to group testusers.. I tried both way add memberuid in group attribute failed. then i tried add memberOf attribute in user to say user is memberof testusers....
then i tried member attribute bcos I have seen it some where in a forum. but that fails too.. anyone to help me on how to add members to groups?
Wednesday, September 6, 2017 1:31 PM
All replies
-
User-389237965 posted
I have copied the code here
myLdapConnection.Bind(); string groupdn = "ou="+groupname+",ou=groups" + dc; string userdn = "cn=" + username + usersdc ; DirectoryAttributeModification addnewusertogroup = new DirectoryAttributeModification(); addnewusertogroup.Operation = DirectoryAttributeOperation.Replace; addnewusertogroup.Name = "member"; addnewusertogroup.Add(groupdn); ModifyRequest modifyreq = new ModifyRequest(userdn , addnewusertogroup);
add memberuid to group
myLdapConnection.Bind(); string groupdn = "cn="+groupname +",ou=Groups" + dc; string userdn = "cn=" + username + usersdc; String[] attribVals = new String[1]; attribVals[0] = userdn; ModifyRequest modifyreq = new ModifyRequest(groupdn, DirectoryAttributeOperation.Add, "memberUid", attribVals);
Wednesday, September 6, 2017 1:36 PM -
User1771544211 posted
Hi gimovid,
I just replied on the older thread(https://forums.asp.net/t/2127524.aspx), please check.
Best Regards,
Jean
Thursday, September 7, 2017 7:20 AM -
User-389237965 posted
jean, when i pulled out sample details of a windows AD user i can see memberOf attribute is there ... but i cannot user that in openldap user. is there anyway that i can add groups (array of groups) to a user ?
I am using inetorgPerson object class for user.
Thursday, September 7, 2017 12:41 PM -
User1771544211 posted
Hi gimovid,
I have replied on your older thread, I suggest that we can keep tracking this issue in this new thread then.
Best Regards,
Jean
Monday, September 11, 2017 9:08 AM