SF v5.1 Import users from CSV

Posted by Community Admin on 04-Aug-2018 20:49

SF v5.1 Import users from CSV

All Replies

Posted by Community Admin on 21-Aug-2012 00:00

What is the proper method for mass importing users from CSV on SiteFinity v 5.1?  I'd like to import via CSV and also force the user to set a new password after their initial login.

Posted by Community Admin on 31-Aug-2012 00:00

This would be extremely useful.  It would also be nice to import any generic data to the database with csv when creating a custom module.

Posted by Community Admin on 07-Sep-2012 00:00

I am also interested in a feature that will allow me to import users or customers from a flat file(.csv).  Maybe someone with skills and free time can that take the control that is used for importing subscribers for emails campaigns and make it work for importing users?  I'm not sure if you can access the Import Subscribers code and reuse it with the help of Sitefinity Thunder.  

Here's the basics and link to documentation

var userManager = UserManager.GetManager("Default");
System.Web.Security.MembershipCreateStatus status;
userManager.Provider.SuppressSecurityChecks = true;
var user = userManager.CreateUser("user1@test.com", "user1234@", "user1@test.com", "Question", "Answer", true, null, out status);
 
user.FirstName = "FirstName";
user.LastName = "LastName";
userManager.SaveChanges();
  
RoleManager roleManager = RoleManager.GetManager("AppRoles");
roleManager.Provider.SuppressSecurityChecks = true;
var role = roleManager.GetRole("Administrators");
roleManager.AddUserToRole(user, role);
roleManager.SaveChanges();

This thread is closed