diff options
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/netcmd/group.py | 4 | ||||
-rw-r--r-- | source4/scripting/python/samba/tests/samba_tool/group.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source4/scripting/python/samba/netcmd/group.py b/source4/scripting/python/samba/netcmd/group.py index 5cd9ba8701..265170d2d2 100644 --- a/source4/scripting/python/samba/netcmd/group.py +++ b/source4/scripting/python/samba/netcmd/group.py @@ -346,13 +346,13 @@ samba-tool group listmembers \"Domain Users\" -H ldap://samba.samdom.example.com search_filter = "(|(primaryGroupID=%s)(memberOf=%s))" % (rid, group_dn) res = samdb.search(samdb.domain_dn(), scope=ldb.SCOPE_SUBTREE, expression=(search_filter), - attrs=["cn"]) + attrs=["samAccountName"]) if (len(res) == 0): return for msg in res: - self.outf.write("%s\n" % msg.get("cn", idx=0)) + self.outf.write("%s\n" % msg.get("samAccountName", idx=0)) except Exception, e: raise CommandError('Failed to list members of "%s" group ' % groupname, e) diff --git a/source4/scripting/python/samba/tests/samba_tool/group.py b/source4/scripting/python/samba/tests/samba_tool/group.py index b7f751747d..2c0c46e5dc 100644 --- a/source4/scripting/python/samba/tests/samba_tool/group.py +++ b/source4/scripting/python/samba/tests/samba_tool/group.py @@ -130,12 +130,12 @@ class GroupCmdTestCase(SambaToolCmdTest): grouplist = self.samdb.search(base=self.samdb.domain_dn(), scope=ldb.SCOPE_SUBTREE, expression=search_filter, - attrs=["cn"]) + attrs=["samAccountName"]) self.assertTrue(len(grouplist) > 0, "no groups found in samdb") for groupobj in grouplist: - name = groupobj.get("cn", idx=0) + name = groupobj.get("samAccountName", idx=0) found = self.assertMatch(out, name, "group '%s' not found" % name) def _randomGroup(self, base={}): |