How to query user by role For a role named 'reviewer' : $uids = \Drupal::entityQuery('user')->condition('roles.target_id','reviewer')->execute(); Voilà a Reply