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='{642C9A7E-EE31-4979-86F0-39F338C10AFB}' AND @email='abc@123.com']
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='{642C9A7E-EE31-4979-86F0-39F338C10AFB}' AND @email='abc@123.com']
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 resultingUser
objects by their name property. You could do something similar like this: