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
Gary Payne 9Gary Payne 9 

Can user passwords be reset without sending the email notification?

We want our users to click their SSO link to login instead of their usual Salesforce.com login.  IT has requested to rest the users' passwords but not to send them the email notification to reset their password.  Any ideas on how this can be done?
Rakesh51Rakesh51
As per my experience no, you can't
NareshGNareshG
Yes, you can do this using apex code. Use System.resetPassword method. Pass the second parameter as false.

System.resetPassword(<UserId>, false);
Tamal Chakraborty 2Tamal Chakraborty 2
@nareshG   can you explain a little more as to where and how to use this code ?
Tamal Chakraborty 2Tamal Chakraborty 2
i see another solution here  but not sure how to pass a list of usernames ?  i need to setup say 100 users with a same pwd for login to SF . how to accomplish this 

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_user_password.htm
Pavan KaundalPavan Kaundal
You can list out all the UserIds in a list and using for loop you can reset:

Open the Developer console, under debug --> open execute anonymous window

List<Ids> resetUserids = new List<String>{'userid1', 'userId2'.............};
for(Id u : resetUserids)
{
       System.setpassword( u, 'desiered password');
}

hit execute