We have a requirement to import existing users (about 100,000) from another application into Salesforce as Community Users. Existing users have a email address as their username and a password that is currently stored in LDAP which I can extract.

I think there are 3 options to do this:

  1. Use data loader to load them as users. But this will not allow me to load passwords. I think a second step is required to load up password separately.
  2. I've seen somewhere that we may use Salesforce API to do mass user provisioning including uploading the password.
  3. Use Site.createPortalUser

As a newbie to Salesforce I have not done #2/#3 before. I basically need to load up the users including their password into the Community. I would like to know if anybody have any examples with option #2/#3 or any other suggestions is greatly appreciated.

2 Answers 2


Though not exactly your use case, you could use the registerUser() method found in the Site Class documentation as a good starting point for option #3.

Is single sign-on an option? If it is, you could even use JIT provisioning over SAML.

  • SSO using SAML Identify Connect was one of the option however we decided not to use it but rather have Salesforce solely as the identity provider because of other architectural constraints.
    – Beatle
    Jul 27, 2015 at 4:21

The best option I can think of is like this -

Use data loader, so that it is easier for you as well. make sure to add proper email ids of the users in you CSV file to upload. Thigs to take care -

  1. Make sure profile id is correct for all users
  2. This profile is already added to the community

Now when you publish your community, Salesforce will send proper emails to all users for the profiles added in community settings and they can set their passsword.

Why this is preferred ?

  1. Ideally every user should have their privacy of password
  2. You do not need to worry about maintaining all passwords (be calm and let SF handle it :))
  3. If they want to change passowrd or update it they can do that usign standard SF features only. No overhead

Update 1

If we want to set password automatically -

  1. Create a batch class (as user count is too much)
  2. Import all usernames and password in a temporary object using data loader.
  3. Use data from this above point temporary object and Use Site.CreateExternalUser method of salesforce (reference - Site class method)
  4. In the method, set "sendEmailConfirmation" param as true if you want to notify users as well else false.

Do let me know if i have not made any point clear, also if it helps.



  • This is my preferred way too, but unfortunately there is a business requirement to bring existing passwords across from external application into SF. Therefore to the user it is just a new website, they can login with their existing email address and password.
    – Beatle
    Jul 27, 2015 at 6:13
  • @beatle, added Update 1 based on your requirement. Let me know if it will help
    – SEuser
    Jul 27, 2015 at 6:47
  • Thanks for your great suggestion Ray, I will definitely try this out. Do I call the Site.CreateExternalUser from the batch class ?
    – Beatle
    Jul 28, 2015 at 0:10
  • Yes @Beatle, , you will need to call this from batch. Never tried this, but it should work. I would suggest setting batch size as near to 2000-3000. Do let me know how it goes or for any further help.!!
    – SEuser
    Jul 28, 2015 at 7:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .