Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

exp:expusercreate

Create a user account through the content publish, as the administration does (its workflows and the approval of new accounts run): login, e-mail, names, groups, and a password from standard input, a generated one or…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/examples/commands/expusercreate.md

On this page

exp:expusercreate

Create a user account through the content publish, as the administration does (its workflows and the approval of new accounts run): login, e-mail, names, groups, and a password from standard input, a generated one or the activation mail (a dry run unless --apply).

Script bin/php/expusercreate.php, code in kernel/private/classes/commands/expusercreate.php. Run it from the installation root, as the user the web server runs as:

./console exp:expusercreate --help
./console exp:user:create --help
php bin/php/expusercreate.php --help

Help text

Create a user account
Creates the account as a content object of a user class in its first group and publishes it with
the content/publish operation, exactly as the administration does: its workflows run, so where
new accounts need approval the account waits until it is approved. The other groups are added as
locations. Choose one way to the password: --password-stdin (one line on standard input, never
on the command line), --generate-password (printed once) or --send-activation (the account starts
disabled and gets the activation mail). Without --apply nothing is created: the command lists what
it would do and which checks fail.

./console exp:user:create --login=jane [email protected] --first-name=Jane --last-name=Doe \
    --group=Editors --generate-password --apply
printf '%s\n' "$PASSWORD" | ./console exp:user:create --login=ci-bot [email protected] --group=12 --password-stdin --apply
./console exp:user:create --login=member1 [email protected] --group=Members --send-activation --apply

Options

OptionValueHelp
--loginrequiredThe login name (create: of the new account; edit: the new login name)
--emailrequiredThe e-mail address (create: of the new account; edit: the new address)
--first-namerequiredThe first name (the attribute first_name of the user class)
--last-namerequiredThe last name (the attribute last_name of the user class)
--grouprequiredA user group by node id or name: list, export and bulk take only its members (below it, at any depth); create and import: the group of the new accounts (repeat for more, the first is the main group; default [UserSettings] DefaultUserPlacement)
--classrequiredThe user class of the new account (default the class of [UserSettings] UserClassID)
--password-stdinRead the password from standard input (one line), never from the command line (create and reset-password: it must pass the password rules)
--generate-passwordGenerate a password that passes the password rules and print it once
--send-activationCreate the account disabled and send the activation mail; the person sets a password with "Forgot password"
--disabledCreate the account disabled (enable it later with exp:user:enable)
--applyMake the change; without it the command only lists what it would change (a dry run)
--dry-runThe default, kept for scripts that pass it: list what would change, change nothing
--asrequiredAct as this user (login, e-mail or id; default the user of [UserSettings] UserCreatorID); the audit records it as who did it
--formatrequiredtext (default) or json (the machine output exp-user/1)

Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).


Generated by ./console exp:help:examples from bin/php/expusercreate.php, kernel/private/classes/commands/expusercreate.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x