You need to sign in to do that
Don't have an account?
LinThaw
mass reset password
hi there,
Is there anyway to reset password for multiple users from apex?
the following can reset one user per transcation.
String newPassword = System.resetPassword(usrId ,false).getPassword();
Thanks in advance
LinThaw.
Is there anyway to reset password for multiple users from apex?
the following can reset one user per transcation.
String newPassword = System.resetPassword(usrId ,false).getPassword();
Thanks in advance
LinThaw.
You can use below code for reset password of multiple users.
You have to execute code it through developer console.
It is easy, just a few clicks, copy and paste a shortcode below will do. Navigate to your name and click Developer Console menu. It will open a new window, Debug | Open Execute Anonymous Window, copy and paste the code below to the Enter Apex Code windows and click Execute button.
You have to execute above (changepassword ch= new changepassword();) in the Open Execute Anonymous Window. With this help, All multiple users password has been changed.
Please implement it.
Thanks,
Arvind Kumar
It can be get Governor error if there are above 150 active users.
How do you think?
Regards,
LinThaw
It will work for all 150 active users. You will not get any error because we are using one soql query in this code.
So try it.
Thanks,
Arvind Kumar
Yes, It will work for all 150 active users.
If so there is no way for more than 150 users?
System.LimitException: Too many DML statements: 151
Regards,
LinThaw
Don't take a tension.
It will work for more than 150 active users.
In your excute9) mehod call the method to reset password and use a batch size less than 150 when you all the batch,
please let me share more info.
Thanks.
Regards,
LinThaw.
System.InvalidParameterValueException: UNKNOWN_EXCEPTION: invalid repeated password