summaryrefslogtreecommitdiff
path: root/source4/setup
diff options
context:
space:
mode:
Diffstat (limited to 'source4/setup')
-rwxr-xr-xsource4/setup/newuser3
-rwxr-xr-xsource4/setup/setpassword2
2 files changed, 3 insertions, 2 deletions
diff --git a/source4/setup/newuser b/source4/setup/newuser
index 281e3849fa..cc89e922a7 100755
--- a/source4/setup/newuser
+++ b/source4/setup/newuser
@@ -36,6 +36,7 @@ credopts = options.CredentialsOptions(parser)
parser.add_option_group(credopts)
parser.add_option("--quiet", help="Be quiet", action="store_true")
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")
opts, args = parser.parse_args()
@@ -57,4 +58,4 @@ creds = credopts.get_credentials(lp)
samdb = sambaopts.get_hostconfig().get_samdb(session_info=system_session(),
credentials=creds)
-samdb.newuser(username, opts.unixname, password)
+samdb.newuser(username, opts.unixname, password, force_password_change_at_next_login=opts.must_change_at_next_login)
diff --git a/source4/setup/setpassword b/source4/setup/setpassword
index d44f143e63..77d97d8918 100755
--- a/source4/setup/setpassword
+++ b/source4/setup/setpassword
@@ -75,5 +75,5 @@ creds = credopts.get_credentials(lp)
samdb = SamDB(url=lp.get("sam database"), session_info=system_session(),
credentials=creds, lp=lp)
-samdb.setpassword(filter, password, must_change_at_next_login=opts.must_change_at_next_login)
+samdb.setpassword(filter, password, force_password_change_at_next_login=opts.must_change_at_next_login)