User management from the console
The exp:user commands manage the user accounts of an installation from a shell, a deploy script or a CI job. Each
command does what the administration does when you click: the same operations, workflows, checks, mails and audit
events. Nothing changes until you add --apply.
Use them when you look after many accounts, when you work on the server without a browser, when a script sets up an installation, or when an administrator is locked out.
Contents
Start here
- First time: read the tutorial User management from the console. It walks through finding, creating, changing and removing accounts.
- By role: For site administrators, For developers: scripts and CI and For agencies and hosting.
- A quick answer: the FAQ. An error: When a command fails.
- What the feature adds: User management from the console.
The commands
Every command prints all its options with --help. <user> is a login, an e-mail address (when only one account
has it) or the account's id.
| Command | What it does | Page |
|---|---|---|
exp:user:list, exp:user:show | find and inspect accounts | Find, create and change accounts |
exp:user:create, exp:user:edit | create an account, change its address, login, names and groups | Find, create and change accounts |
exp:user:disable, exp:user:enable, exp:user:delete | stop an account, start it again, remove it for good | Disable, enable and remove accounts |
exp:user:reset-password, exp:user:require-password-change, exp:user:check-login | passwords and sign-in checks | Passwords and sign-in checks |
exp:user:pending, exp:user:approve, exp:user:resend-activation | registrations that wait | Approve registrations |
exp:user:groups, exp:user:roles, exp:user:whoami | user groups, role assignments, who the console acts as | Groups and roles |
exp:user:sessions, exp:user:unlock, exp:user:2fa | sessions, locked accounts, two-step sign-in and passkeys | Sessions and sign-in security |
exp:user:export, exp:user:import, exp:user:bulk | many accounts at once | Import, export and bulk changes |
exp:user:audit, exp:user:hygiene | the history of an account, the state of all accounts | Audit and hygiene |
Three rules every command follows
A dry run unless --apply. A command that changes something first lists what it would do and which checks fail.
Add --apply to make the change. --dry-run is accepted and means the same as no flag; both together are a usage
error (exit code 2).
No password on the command line. No command takes --password=..., because the shell history and the process
list would keep it. A password comes from standard input (--password-stdin), is generated and printed once, or is
chosen by the person through a mail.
Who acts is recorded. The commands act as the user of site.ini [UserSettings] UserCreatorID, or as the user
you name with --as=<login>. The audit trail and the user audit log record that user and the siteaccess.
Protected accounts are never disabled or removed: the anonymous user, the UserCreatorID user, the
administrator account (id 14 or the login admin), the user who acts and the last enabled administrator.
Tasks
| Task | Page |
|---|---|
| Set up an account for a new editor | Onboard a new editor |
| Close the access of someone who leaves | Offboard someone who leaves |
| Work through many waiting registrations | Approve a backlog of registrations |
| Get an administrator back in | Recover a locked-out administrator |
| Help someone who lost the phone with the authenticator app | Reset two-step sign-in after a lost phone |
| Create many member accounts from a spreadsheet | Bulk-import members from CSV |
More
- The JSON output and exit codes, key by key: exp:user JSON output.
- The same tasks in the administration: Setting up accounts for editors and administrators, Managing members, The user audit log and Check user accounts.
- Every command with all its options: Console commands.