mirror of
https://github.com/samba-team/samba.git
synced 2025-07-22 16:59:09 +03:00
samba-tool: Added new "user disable" command
This commit is contained in:
committed by
Andrew Tridgell
parent
34ff5d29e6
commit
1cef3212a1
@ -80,6 +80,16 @@ class SamDB(samba.Ldb):
|
||||
'''return the domain DN'''
|
||||
return str(self.get_default_basedn())
|
||||
|
||||
def disable_account(self, search_filter):
|
||||
"""Disables an account
|
||||
|
||||
:param search_filter: LDAP filter to find the user (eg
|
||||
samccountname=name)
|
||||
"""
|
||||
|
||||
flags = samba.dsdb.UF_ACCOUNTDISABLE | samba.dsdb.UF_PASSWD_NOTREQD
|
||||
self.toggle_userAccountFlags(search_filter, flags, on=True)
|
||||
|
||||
def enable_account(self, search_filter):
|
||||
"""Enables an account
|
||||
|
||||
|
Reference in New Issue
Block a user