DEV Community

Cover image for Bulk-create editor users in Drupal by mail address
Florian Stolzenhain
Florian Stolzenhain

Posted on • Edited on

Bulk-create editor users in Drupal by mail address

Original post on my blog, happy to include feedback!
Cover: Biblioteca de Arte / Art Library Fundação Calouste Gulbenkian, via New Old Stock

This creates a user according to it's email, sets a role and creates a 24h valid one-time-login.
The link can be transmitted for easy setup of password and account settings.

drush user-create [username] --mail="[user@mail]" &&\
    drush user-add-role "[editor]" [username] &&\
    drush uli --uri="[https://example.com]" --name="[username]"
Enter fullscreen mode Exit fullscreen mode

For adding a role to multiple users, use comma separated arguments:

drush user-add-role "[editor]" [username1,username2]
Enter fullscreen mode Exit fullscreen mode

Documentation

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs