A simple task: list all the users on a site, optionally filtering by role or by status. Difficulty: using drush.
I had searched around a bit for this functionality and my Google-fu had failed me, so I decided to build off of work that already had been done and write a drush user-list command. (The internal monologue went something like this: "Is this a thing? It doesn't look like this is a thing. This should be a thing. Why is this not a thing? Let's make this a thing.")
Installation
Download user_list from Github or drupal.org and place it where you place the rest of your drush commands (e.g., in ~/.drush/
or /usr/share/drush/commands/
)
Use
drush user-list
Returns a table of all users on the site.
drush user-list --status=active
Returns a table of all active users on the site.
drush user-list --roles="administrator,site owner"
Returns a table of all users with the role "administrator" or "site owner" on the site.
That's pretty much it.
Categories: