示例#1
0
        public static List <UserDto> GetUsersByName(string searchName)
        {
            var activeDirectoryHelper = new ActiveDirectoryHelper();
            var userDtos = activeDirectoryHelper.FindUsersByName(searchName);

            return(userDtos);
        }
示例#2
0
        public static UserDto GetUserBySamAccountName(this IPrincipal user, string samAccountName)
        {
            var activeDirectoryHelper = new ActiveDirectoryHelper();
            var userDto = activeDirectoryHelper.FindUsersBySamAccountName(samAccountName);

            return(userDto);
        }
示例#3
0
        public static bool CheckUserGroupMembership(this IPrincipal user, List <string> groups)
        {
            var activeDirectoryHelper = new ActiveDirectoryHelper();

            return(activeDirectoryHelper.IsMemberOfGroup(groups, user.GetUsernameWithoutDomain()));
        }