Another great way to speed up our development in Drupal is to use Drush to manage users.
If we open a terminal window and navigate to our Drupal project, we can enter the following command to retrieve a list of commands:
drush
If we scan down the list, we can locate all the User commands
:
We will take a deeper look at utilizing Drush to quickly perform the following tasks:
- Displaying user information
- Adding and removing roles from a user
- Blocking and unblocking a user
- Creating and deleting user accounts
- Creating a one-time login
Using Drush to retrieve user information is simple. If we know the user ID associated with the user, we can use the drush user-information
command to return information about that user. We can locate the user ID by navigating to the People
panel in Drupal and hovering over the username. In our example, the developer
user has an ID of 2
.
We can open a terminal window and enter the following command to retrieve our developer...