diff options
author | Giampaolo Lauria <lauria2@yahoo.com> | 2011-11-08 14:59:19 -0500 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-11-10 14:24:21 +1100 |
commit | 1cef3212a1099b87769c473ee99c0c0f2a4d2b04 (patch) | |
tree | 03376d2d1ccf0d263e447644c905d57fb1832030 /source4/scripting/python/samba/samdb.py | |
parent | 34ff5d29e66eac3041204b9cd481a2e7887b1fc9 (diff) | |
download | samba-1cef3212a1099b87769c473ee99c0c0f2a4d2b04.tar.gz samba-1cef3212a1099b87769c473ee99c0c0f2a4d2b04.tar.bz2 samba-1cef3212a1099b87769c473ee99c0c0f2a4d2b04.zip |
samba-tool: Added new "user disable" command
Diffstat (limited to 'source4/scripting/python/samba/samdb.py')
-rw-r--r-- | source4/scripting/python/samba/samdb.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py index df05a5208b..a21ed76e6b 100644 --- a/source4/scripting/python/samba/samdb.py +++ b/source4/scripting/python/samba/samdb.py @@ -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 |