function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Reset password using data loader

we have to add 200 users every month . But we want to reset the password using data loader at a later stage after adding the users.
Is this possible?
Chirag MehtaChirag Mehta

Develop a small JAVA or NET code which will call resetPassword Webservice API


string password = binding.resetPassword(ID userID);


Use resetPassword() to request that the API change the password of a User or SelfServiceUser, and return a system-generated password string of random letters and numbers. Use setPassword() instead if you want to set the password to a specific value.


Your client application must be logged in with sufficient access rights to change the password for the specified user. For more information, see Factors that Affect Data Access.

Sample Code—Java

public void resetPasswordSample() {
// Specify the user ID of the password to reset
ID idToReset = new ID("005x0000000fFLnAAM");
// Invoke the resetPasswordResult call
try {
ResetPasswordResult resetPasswordResult = binding.resetPassword(idToReset);
// Display the new server-generated password
} catch (Exception ex) {
System.out.println("An unexpected error has occurred." + ex.getMessage());




Is there anyway I can use setPassword from Apex? If so, does anyone know the syntax? Right now I am getting Method does not exist or incorrect signature: setPassword(String, String).


Thanks in advance,