Is there a way to use fast query or query to get a user by email or a custom field? I tried this but it didn\'t work in the Query Tool
/sitecore/user//*[@@templateid=\'
You cannot query (via Sitecore Query or Fast Query) users in the User Manager because they are not items, they're actually built on ASP.NET Membership in the Core database. Instead, you can look into something like Membership.GetAllUsers()
(MSDN doc) and filter the results with LINQ based on what you're looking for.
I've done something similar in Sitecore where I called Sitecore.Security.Accounts.UserManager.GetUsers()
and filtered the resulting User
objects by their name property. You could do something similar like this:
var matches = UserManager.GetUsers().Where(usr => usr.Profile.Email.Equals(emailToMatch));