summaryrefslogtreecommitdiff
path: root/source4/setup/newuser
diff options
context:
space:
mode:
Diffstat (limited to 'source4/setup/newuser')
-rwxr-xr-xsource4/setup/newuser10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/setup/newuser b/source4/setup/newuser
index 10af55a458..ef65d36dfb 100755
--- a/source4/setup/newuser
+++ b/source4/setup/newuser
@@ -37,6 +37,7 @@ parser.add_option_group(sambaopts)
parser.add_option_group(options.VersionOptions(parser))
credopts = options.CredentialsOptions(parser)
parser.add_option_group(credopts)
+parser.add_option("-H", help="LDB URL for database or target server", type=str)
parser.add_option("--unixname", help="Unix Username", type=str)
parser.add_option("--must-change-at-next-login", help="Force password to be changed on next login", action="store_true")
@@ -58,6 +59,11 @@ if opts.unixname is None:
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
-samdb = SamDB(url=lp.get("sam database"), session_info=system_session(),
- credentials=creds, lp=lp)
+if opts.H is not None:
+ url = opts.H
+else:
+ url = lp.get("sam database")
+
+samdb = SamDB(url=url, session_info=system_session(), credentials=creds, lp=lp)
+
samdb.newuser(username, opts.unixname, password, force_password_change_at_next_login_req=opts.must_change_at_next_login)