exp:expuserbulk
Disable, enable, delete, approve, reject or unlock every account the list filters select, each as the single command does it; --apply needs --confirm with the number the dry run showed.
Script bin/php/expuserbulk.php, code in kernel/private/classes/commands/expuserbulk.php. Run it from the installation root, as the user the web server runs as:
./console exp:expuserbulk --help
./console exp:user:bulk --help
php bin/php/expuserbulk.php --helpHelp text
One action for many accounts
disable, enable, delete, approve, reject or unlock every account the filters of exp:user:list
select (--state, --group, --search, --days), at most --limit. Each account goes through the same
checks as the single command: protected accounts and the last administrator are listed and never
changed. The dry run lists the accounts and their number; --apply also needs --confirm=<that
number>, and runs only while the filter still selects exactly as many.
./console exp:user:bulk disable --state=inactive --days=730 --group=Members
./console exp:user:bulk disable --state=inactive --days=730 --group=Members --apply --confirm=42
./console exp:user:bulk approve --state=pending --search=example.edu --apply --confirm=17Options
| Option | Value | Help |
|---|---|---|
--state | required | Only accounts in this state: all (default), enabled, disabled, unactivated, pending, locked, never, inactive, orphaned, duplicate_login or duplicate_email |
--group | required | A 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) |
--search | required | Only accounts whose login, name or e-mail address contains this text |
--days | required | With --state=inactive: not signed in for this many days (default 180) |
--limit | required | How many to list (default 25, at most 500); bulk: the most accounts one run may change (default 500, at most 5000) |
--confirm | required | With --apply: the number of accounts the filter selects, as the dry run showed it; the action runs only when it still matches |
--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) |
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 ...).
Arguments: [action].
Related
Generated by ./console exp:help:examples from bin/php/expuserbulk.php, kernel/private/classes/commands/expuserbulk.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.