Skip to the content
Documentation

exp:expuserbulk

No ratings yet

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

Summary

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

Usage

./console exp:expuserbulk [options]
php bin/php/expuserbulk.php [options]
./console exp:user:bulk [options]

Aliases

exp:user:bulk

Help

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

Usage: bin/php/expuserbulk.php [OPTION]... [ACTION]
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=17


Options:
  --state=VALUE    Only accounts in this state: all (default), enabled, disabled, unactivated, pending, locked, never, inactive, orphaned, duplicate_login or duplicate_email
  --group=VALUE    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=VALUE   Only accounts whose login, name or e-mail address contains this text
  --days=VALUE     With --state=inactive: not signed in for this many days (default 180)
  --limit=VALUE    How many to list (default 25, at most 500); bulk: the most accounts one run may change (default 500, at most 5000)
  --confirm=VALUE  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=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
--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)

Arguments

[action]

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/expuserbulk.php, kernel/private/classes/commands/expuserbulk.php

See also

Generated example: exp:expuserbulk

Added to the reference for Exponential 6.0.15.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.