Getting a list of users that belong to a specific role in Drupal multisite

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by humansky on August 11, 2015 at 2:35pm

I'm trying to get a list of user emails that belong to the role 'site administrators' from a remote multisite Drupal environment. When I run the following command:

drush @remote_site sql-query 'SELECT DISTINCT u.mail FROM users AS u LEFT JOIN users_roles AS ur ON u.uid=ur.uid LEFT JOIN role AS r ON ur.rid=r.rid WHERE r.name = "site administrator"'

The SQL query works, however, it only works for the "default" site. Is there anyway to run this command for all the sites in my environment? I tried adding "@sites" after the remote alias, but it still only points to the default folder. Any ideas?

Thank you,
Henry

Categories: ,

Comments

Accidentally submitted the

Posted by humansky on August 13, 2015 at 1:31pm

Accidentally submitted the form twice, please refer to this discussion for more informaiton:

https://groups.drupal.org/node/476808

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /