Sitecore 8.1 here, I'm currently using the Sitecore AD Module 1.3.

When I search through my users from the back-end using the User Manager, I can easily find all the users I want.

When I try to retrieve the from my code though, using UserManager.GetUsers(), some users - seemingly at random - don't show up at all.


Why is this happening?

Is there a configuration field I'm not aware of that makes so that they don't show up when I invoke GetUsers()?

1 Answer 1


Basically, Sitecore uses standard .NET Membership provider.

I would suggest to check what a membership provider is configured in your solution.To do that go to:

web.config -> /configuration/system.web/membership/providers

You may have a custom override membership provider where you can have a wrong implementation of some required methods.

Just try to use the following static method of the standard Microsoft Membership provider:

Membership.FindUsersByName(usernameToMatch, pageIndex, pageSize, out totalRecords) 
  • I do - I am, in fact, using the AD Module. I even decompiled their DLL to try to figure out what's going wrong, but to no avail. Jan 10, 2019 at 15:16
  • I remember, I had pretty the same issue when I used Sitecore.Security.Domains.Domain.GetUsers() where PagingIterator with yield return was returning wrong amount of users. Jan 10, 2019 at 15:41
  • So, how did you got around it? Jan 10, 2019 at 15:49
  • 1
    I used to another Sitecore.Security.Domains.Domain.GetUsersByName(some params) method that the same as above but does not use custom iterator: MembershipUserCollection usersByName = Membership.FindUsersByName(this.AccountPrefix + search, pageIndex, pageSize, out total); List<User> userList = new List<User>(); foreach (MembershipUser membershipUser in usersByName) userList.Add(User.FromName(membershipUser.UserName, false)); return (IEnumerable<User>) userList; Jan 10, 2019 at 15:56
  • Looping through FindUsersByName did the trick, thanks! Apparently, I am unable to return all the users in one go. Jan 10, 2019 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.