Drupal EntityQuery is the… Drupal EntityQuery is the solution. For that, you can use the following code $query = \Drupal::entityQuery('user'); $query->condition('name', '%admin%','LIKE'); $ids = $query->execute(); Find Entity using Drupal EntityQuery Reply