More in this section
Forums / General Discussions / Import users from CSV??

Import users from CSV??

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
4 posts, 0 answered
  1. Eli
    Eli avatar
    2 posts
    06 May 2013
    24 Apr 2014
    Link to this post
    Has anyone had any luck creating something custom that does this?
  2. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    26 Mar 2015
    28 Apr 2014
    Link to this post
    Hi Eli,

    There is no way to directly import users from an .csv. You will need to add them by creating a custom membership provider and use the users from the other system:Create a custom membership provider or use the API to create the users in  Sitefinity:Creating users and Creating user profiles.

    Ivan D. Dimitrov
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
  3. Roshith
    Roshith avatar
    0 posts
    05 Oct 2016
    21 Oct 2016
    Link to this post
    How to read data from CSV files ?
  4. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    01 Jul 2014
    23 Oct 2016 in reply to Roshith
    Link to this post

    Hi Roshith,

    Very rough example how to read from CSV file and then create users in Sitefinity:

    // CSV format username;password;firstName;lastName;mail;secretQuestion;secretAnswer;isApproved
    public static void YourFunction()
        var users = File.ReadAllLines("users.csv");
        foreach (var user in users)
            var data = user.Split(";");
            CreateUser(data[0], data[1], data[2], data[3], data[4], data[5], data[6], bool.Parse(data[7]));
    public static MembershipCreateStatus CreateUser(string username, string password, string firstName, string lastName, string mail, string secretQuestion, string secretAnswer, bool isApproved)
        UserManager userManager = UserManager.GetManager();
        UserProfileManager profileManager = UserProfileManager.GetManager();
        System.Web.Security.MembershipCreateStatus status;
        User user = userManager.CreateUser(username, password, mail, secretQuestion, secretAnswer, isApproved, null, out status);
        if (status == MembershipCreateStatus.Success)
            SitefinityProfile sfProfile = profileManager.CreateProfile(user, Guid.NewGuid(), typeof(SitefinityProfile)) as SitefinityProfile;
            if (sfProfile != null)
                sfProfile.FirstName = firstName;
                sfProfile.LastName = lastName;
        return status;



4 posts, 0 answered