public static List <UserDto> GetUsersByName(string searchName) { var activeDirectoryHelper = new ActiveDirectoryHelper(); var userDtos = activeDirectoryHelper.FindUsersByName(searchName); return(userDtos); }
public static UserDto GetUserBySamAccountName(this IPrincipal user, string samAccountName) { var activeDirectoryHelper = new ActiveDirectoryHelper(); var userDto = activeDirectoryHelper.FindUsersBySamAccountName(samAccountName); return(userDto); }
public static bool CheckUserGroupMembership(this IPrincipal user, List <string> groups) { var activeDirectoryHelper = new ActiveDirectoryHelper(); return(activeDirectoryHelper.IsMemberOfGroup(groups, user.GetUsernameWithoutDomain())); }