Skip to content

Instantly share code, notes, and snippets.

@visabhishek
Last active January 28, 2016 09:59
Show Gist options
  • Save visabhishek/0fb0b93cbc3d8591eb96 to your computer and use it in GitHub Desktop.
Save visabhishek/0fb0b93cbc3d8591eb96 to your computer and use it in GitHub Desktop.
#!/bin/bash
drush sqlq "SELECT DISTINCT(SELECT name from users where uid = ur.uid) FROM users_roles AS ur WHERE ur.rid IN (4) LIMIT 50" | while read username;
do
echo "Updating Password for Users $username"
drush upwd $username --password='Pass@123'
# or do whatever with individual element of the array
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment