0

We manually create users via the Acquia Cloud Sites Factory. I want to create a script that bulk creates users at one time using a .csv file with just username, email, and password.

I know I can use a command like drush ucrt username —password password1 —mail [email protected], but I need to create multiple users at the same time.

How can I achieve this?

2
  • Which drupal version ? Commented Aug 4, 2018 at 10:04
  • Using Drupal 8 on Acquia
    – Taz Brown
    Commented Aug 6, 2018 at 17:36

2 Answers 2

1
  1. Use a shell-script to stick the drush ucrt-command in a loop reading from the .csv-file.
  2. If you're on Drupal 7, use contributed module User Import.
5
  • Ok, not sure how to incorporate drush into the script
    – Taz Brown
    Commented Aug 6, 2018 at 15:36
  • I figured creating multiple users from a .csv would require a loo, right
    – Taz Brown
    Commented Aug 6, 2018 at 15:36
  • 1) drush is a command like any other CLI-command. you just put the command line containing the drush-command on a line in the script; 2) I've no idea why you would require a loo Commented Aug 6, 2018 at 16:36
  • Well I need to create multiple users at the same time using a .csv file.
    – Taz Brown
    Commented Aug 6, 2018 at 16:50
  • Both methods I've suggested to you will create multiple users at the same time using a .cvs file. Commented Aug 6, 2018 at 17:30
0

If you working with drupal 7 you can use User Import module. Import users into Drupal, or update existing users, with data from a CSV file (comma separated file). Provides a wide range of features out of the box, and a comprehensive API to customise imports.

Features

Create an account for each user

Update existing users option (data can be added or replaced)

Upload Options

Upload CSV files through browser

Use file uploaded through SFTP, FTP,...

Drop an import file into a directory to trigger an automatic import

1
  • Using Drupal 8, so I guess User Import won't work.
    – Taz Brown
    Commented Aug 6, 2018 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.