$users = \Bitrix\Main\UserTable::getList([
"order" => [
"RAND" => "asc"
],
'runtime' => array(
new \Bitrix\Main\Entity\ExpressionField('RAND', 'RAND()')
),
"limit" => 10
])->fetchAll();
$users= \Bitrix\Main\UserTable::getList(
[
'select' => [
'ID', 'ACTIVE', 'EMAIL',
'GROUP_ID' => 'GROUP.GROUP_ID',
],
'runtime' =>
[
new Bitrix\Main\Entity\ReferenceField(
'GROUP',
'\Bitrix\Main\UserGroupTable',
[ '=this.ID' => 'ref.USER_ID' ],
[ 'join_type' => 'LEFT' ]
),
],
]
)->fetchAll();