Skip to the content
Documentation

exp:expuserresetpassword

No ratings yet

Available since Exponential 6.0.15 (in development, not in a release yet).

Summary

Reset a user's password: send the "reset your password" link, set a generated password shown once, or one read from standard input; optionally require a new password at the next sign-in (a dry run unless --apply)

Usage

./console exp:expuserresetpassword [options]
php bin/php/expuserresetpassword.php [options]
./console exp:user:reset-password [options]

Aliases

exp:user:reset-password

Help

The output of ./console help exp:expuserresetpassword (the script run with --help), without the standard options:

Usage: bin/php/expuserresetpassword.php [OPTION]... [USER]
Reset a user's password
Choose one way: --send-link sends the mail of "Forgot password" with its one-time link (the
password stays until the person uses the link); --generate sets a generated password that passes
the password rules and prints it once; --password-stdin sets the password read from standard input
(never from the command line). --generate and --password-stdin end the account's sessions;
--require-change makes the person choose a new password at the next sign-in. The password is
never written to a log or the audit. In demo mode an administrator's password is never changed.
Without --apply nothing is changed and no mail is sent.

./console exp:user:reset-password jane --send-link --apply
./console exp:user:reset-password jane --generate --require-change --apply
./console exp:user:reset-password ci-bot --password-stdin --apply < secret-file


Options:
  --send-link       Send the "reset your password" mail with its one-time link (the password stays until the link is used)
  --generate        Set a generated password that passes the password rules, print it once and end the account's sessions
  --password-stdin  Read the password from standard input (one line), never from the command line (create and reset-password: it must pass the password rules)
  --require-change  The account must choose a new password at its next sign-in
  --apply           Make the change; without it the command only lists what it would change (a dry run)
  --dry-run         The default, kept for scripts that pass it: list what would change, change nothing
  --as=VALUE        Act as this user (login, e-mail or id; default the user of [UserSettings] UserCreatorID); the audit records it as who did it
  --format=VALUE    text (default) or json (the machine output exp-user/1)

Options

Option Value Description
--send-link - Send the "reset your password" mail with its one-time link (the password stays until the link is used)
--generate - Set a generated password that passes the password rules, print it once and end the account's sessions
--password-stdin - Read the password from standard input (one line), never from the command line (create and reset-password: it must pass the password rules)
--require-change - The account must choose a new password at its next sign-in
--apply - Make the change; without it the command only lists what it would change (a dry run)
--dry-run - The default, kept for scripts that pass it: list what would change, change nothing
--as required Act as this user (login, e-mail or id; default the user of [UserSettings] UserCreatorID); the audit records it as who did it
--format required text (default) or json (the machine output exp-user/1)

Arguments

[user]

Standard options

Every script also takes the standard options of the script framework: --help, --quiet, --siteaccess, --debug, --colors, --no-colors, --logfiles, --no-logfiles, --verbose and --allow-root-user.

Source

bin/php/expuserresetpassword.php, kernel/private/classes/commands/expuserresetpassword.php

See also

Generated example: exp:expuserresetpassword

Added to the reference for Exponential 6.0.15.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.