There are a few options to transfer Users and Roles from one instance to another.
You can use the standard Package Designer application from the Development Tools menu in the Sitecore Desktop. You can then add the Roles and Users that you would like to package up for migration, generate the package, download it and then install it on the ...
One option is to hook into Sitecore's user:updated event (and optionally user:updated:remote). This event is raised when a user has been updated, the remote event handler is raised when a user was updated on a remote Sitecore instance.
EDIT: As pointed out in the comments by @SzymonKuzniak, you can also hook into the roles:usersAdded[:remote] event to ...
To get a user by a username you can use :
public class UserRepository
public static User GetUser(string domainName, string userName)
if (User.Exists(domainName + @"\" + userName))
return User.FromName(domainName + @"\" + userName, true);
To get a user roles you can use
If you have a lot of custom user profile data, especially if you have 500k+ users, then your best bet is probably going to be to create a custom SQL database and store your user data, with a key for the each user's record(s) in the database stored in a custom Sitecore user profile field (assuming you are using Sitecore membership, which I believe your ...
You can do this using Sitecore's eventing engine, by creating event handlers for the roles:usersAdded event, the roles:usersAdded:remote event, or both.
The roles:usersAdded event is raised when users have been added to one or more roles on the environment. In other words, if you have a single-server environment then this is the event that you will want to ...
Based on this blog post the only valid options are Comment, Name and Full Name. You can try changing your value from User Name to Full Name but I'm not sure if it will give you what you need. You may need to create a very simple custom field for this, or alternatively create a custom rule action as per the linked article.
You need to change the LoweredUserName column as well. I just tried that and it seems to work.
I couldn't verify if the affected user can still logon or whether he encountered any issues after the update, but the user list was updated correctly and I can still see the full name, email etc...
Thought I would give a more complete answer.
If you would like to use Sitecore PowerShell Extensions to run custom scripts for events you can make use of the Events integration point.
There is an example out of the box that you can check out. You'll need to enable the module to make use of it.
There is also a configuration file distributed with many ...
I recently came across with the same situation where we have created Virtual user and also created some custom property. At the early stage it was working properly as Sitecore user works but one day suddenly it stopped working.
In my solution still Sitecore.Context.User.IsAuthenticated this was always true but all the profile properties was empty at this ...
Typically I like to keep users in Sitecore unless there is a third party membership provider, active directory, OAuth, or SSO solution. If you do not need to use an external membership provider, then use Sitecore.
Also, with external users, you have to make the decision of using a virtual user to authenticate the user or create a Custom Membership Provider, ...
If login fails, you could try to fetch the user and check the Membership user object properties for the status. You can detect the IsApproved flag this way, but not verify the password.
But you actually do not want to give that kind of information. Just tell the user that his account is blocked, don't tell him that the password was correct. As he can't ...
If all you really need to do, is create users based on "Name" and "Email", you don't have to put this in Sitecore at all.
Sitecore runs on a completely standard ASP.NET Membership Provider implementation. Sitecore has a layer on top to allow for Roles-in-Roles membership amongst other things, but under the hood it remains vanilla ASP.NET.
Base your code on ...
Did you recently switch your hashing algorithm to SHA512? If so, you'll need a different password value:
[IsApproved] = '1',
I agree with the comments about not using EF CodeFirst approach with any of the default Sitecore databases. I would suggest using a custom database or only using the core database to query data from existing tables (using CodeFirst based on an existing database). Be careful about any changes you make to any of the default Sitecore databases and tables.
You could override the SqlMembershipProvider and configure ASP.NET (and Sitecore) to use your version, but the extensibility points are so limited that I feel it's not really worth it. Also, the goal of overriding the membership provider is generally to change one of the public methods, in this case ValidateUser. But I think we should leave that method as is,...