Skip to content

Commit 03af2b4

Browse files
kyteinskybackportbot[bot]
authored andcommitted
Add email and generate-password options in user:add
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
1 parent 0104996 commit 03af2b4

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

admin_manual/configuration_server/occ_command.rst

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ report showing how many users you have, and when a user was last logged in::
13601360
You can create a new user with their display name, login name, and any group
13611361
memberships with the ``user:add`` command. The syntax is::
13621362

1363-
user:add [--password-from-env] [--display-name[="..."]] [-g|--group[="..."]]
1363+
user:add [--password-from-env] [--generate-password] [--display-name[="..."]] [-g|--group[="..."]] [--email EMAIL]
13641364
uid
13651365

13661366
The ``display-name`` corresponds to the **Full Name** on the Users page in your
@@ -1411,6 +1411,26 @@ You may also use ``password-from-env`` to reset passwords::
14111411
layla'
14121412
Successfully reset password for layla
14131413

1414+
``generate-password`` allows you to set a securely generated password for the user.
1415+
This is never shown in the output and can be used to create users with temporary
1416+
passwords. This can be used in conjunction with the ``email`` option to create
1417+
users with a temporary password and send a welcome email to the user's email
1418+
address without user interaction::
1419+
1420+
sudo -u www-data php occ user:add layla --generate-password --email layla@example.tld
1421+
The account "layla" was created successfully
1422+
Welcome email sent to layla@example.tld
1423+
1424+
The ``email`` option allows you to set the user's email address when creating
1425+
the user. A welcome email will be sent to the user's email address if
1426+
``newUser.sendEmail`` is set to ``yes`` in ``core``'s app config or not set at all::
1427+
1428+
sudo -u www-data php occ user:add layla --email layla@example.tld
1429+
Enter password:
1430+
Confirm password:
1431+
The account "layla" was created successfully
1432+
Welcome email sent to layla@example.tld
1433+
14141434
You can delete users::
14151435

14161436
sudo -u www-data php occ user:delete fred

0 commit comments

Comments
 (0)