mirror of
https://github.com/samba-team/samba.git
synced 2025-07-27 07:42:04 +03:00
samba-tool: print samaccountname in samba-tool user list
this is the attribute the admin needs for other commands Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
@ -208,15 +208,12 @@ class cmd_user_list(Command):
|
||||
res = samdb.search(domain_dn, scope=ldb.SCOPE_SUBTREE,
|
||||
expression=("(&(objectClass=user)(userAccountControl:%s:=%u))"
|
||||
% (ldb.OID_COMPARATOR_AND, dsdb.UF_NORMAL_ACCOUNT)),
|
||||
attrs=["name"])
|
||||
attrs=["samaccountname"])
|
||||
if (len(res) == 0):
|
||||
return
|
||||
|
||||
try:
|
||||
for msg in res:
|
||||
self.outf.write("%s\n" % msg["name"][0])
|
||||
except Exception, msg:
|
||||
raise CommandError("Failed to get user list: %s" % msg)
|
||||
for msg in res:
|
||||
self.outf.write("%s\n" % msg.get("samaccountname", idx=0))
|
||||
|
||||
|
||||
class cmd_user_enable(Command):
|
||||
|
Reference in New Issue
Block a user