[PATCH] samba-tool group addmembers

Rowland Penny rpenny at samba.org
Wed Jun 7 08:42:03 UTC 2017


Hi, if you try to add a member to a group and the member exists as a
sAMAccountName and a CN, you get this:

root at dc1:~# samba-tool group addmembers group12 rowland
ERROR(exception): Failed to add members "rowland" to group "group12"
- Unable to find "rowland". Operation cancelled. File
"/usr/local/samba/lib/python2.7/site-packages/samba/netcmd/group.py",
line 239, in run add_members_operation=True) File
"/usr/local/samba/lib/python2.7/site-packages/samba/samdb.py", line
278, in add_remove_group_members raise Exception('Unable to find
 "%s". Operation cancelled.' % member)

The user 'rowland' exists here:

dn: CN=Rowland Penny,CN=Users,DC=samdom,DC=example,DC=com
sAMAccountName: rowland

and here:

dn: CN=rowland,OU=SUDOers,DC=samdom,DC=example,DC=com

The problem isn't that 'rowland' doesn't exist, it is that he exists
more than once ;-)

Another user had the same problem, but he created the users with
'--use-username-as-cn'

This patch fixed the problem for me and the other user, it just changes
the search for the user to use only the sAMAccountName attribute.

Rowland
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba-tool-You-cannot-add-members-to-a-group-if-the-.patch
Type: text/x-patch
Size: 1910 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170607/cf5d33fb/samba-tool-You-cannot-add-members-to-a-group-if-the-.bin>


More information about the samba-technical mailing list