diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-05-08 00:48:33 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-05-09 19:14:46 +0200 |
commit | 544dc4465c5ade3c5ed8417ddd5f09d4af0c2b31 (patch) | |
tree | f1a27a1109ee7bc7333d88ecd29430cdb73a615c /source4/scripting | |
parent | 6dfa851ce95b372c6c4bdd7a6c07c1ee183d1f7a (diff) | |
download | samba-544dc4465c5ade3c5ed8417ddd5f09d4af0c2b31.tar.gz samba-544dc4465c5ade3c5ed8417ddd5f09d4af0c2b31.tar.xz samba-544dc4465c5ade3c5ed8417ddd5f09d4af0c2b31.zip |
s4:net utility - add an optional password attribute to "net user add"
To make it behave similar to "net newuser".
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/netcmd/user.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/scripting/python/samba/netcmd/user.py b/source4/scripting/python/samba/netcmd/user.py index 7597f462b65..54ddfe23228 100644 --- a/source4/scripting/python/samba/netcmd/user.py +++ b/source4/scripting/python/samba/netcmd/user.py @@ -29,7 +29,7 @@ from samba.netcmd import ( class cmd_user_add(Command): """Create a new user.""" - synopsis = "%prog user add <name>" + synopsis = "%prog user add <name> [<password>]" takes_optiongroups = { "sambaopts": options.SambaOptions, @@ -37,13 +37,15 @@ class cmd_user_add(Command): "versionopts": options.VersionOptions, } - takes_args = ["name"] + takes_args = ["name", "password?"] - def run(self, name, credopts=None, sambaopts=None, versionopts=None): + def run(self, name, password=None, credopts=None, sambaopts=None, versionopts=None): lp = sambaopts.get_loadparm() creds = credopts.get_credentials(lp) net = Net(creds, lp) net.create_user(name) + if password is not None: + net.set_password(name, creds.get_domain(), password, creds) class cmd_user_delete(Command): |