1
0
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:
Giampaolo Lauria
2011-11-08 14:59:19 -05:00
committed by Andrew Tridgell
parent 34ff5d29e6
commit 1cef3212a1
2 changed files with 43 additions and 0 deletions

View File

@ -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