Using Drush to manage users
When you need to add an account to Drupal, you will visit the People page and manually add a new user. Drush provides the complete user management for Drupal, from creation to role assignment, password recovery, and deletion. This workflow allows you to create users easily and provides them with a login without having to enter your Drupal site.
In this recipe, we will create a staff
role with a staffmember
user and log in as that user through Drush.
How to do it…
- Use the
role-create
command to create a new role labeledstaff
:$ drush role-create staff Created "staff"
- Use the
role-lists
command to verify that the role was created in Drupal:$ drush role-list ID Role Label anonymous Anonymous user authenticated Authenticated ...
Get Drupal 8: Enterprise Web Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.