If you are looking for a code to get all the users for a particular business unit, you can use below code
private EntityCollection RetrieveUserBasedOnBusinessUnit(IOrganizationService _CrmService,Guid BUId)
{
QueryExpression _Query = new QueryExpression
{
EntityName = “systemuser”,
ColumnSet = new ColumnSet(true),
Criteria =
{
Conditions =
{
new ConditionExpression
{
AttributeName=”businessunitid”,
Operator=ConditionOperator.Equal,
Values={BUId}
}
}
}
};
return _CrmService.RetrieveMultiple(_Query);
}
Enjoy !!!