It should come as no surprise that resetting a user’s password is the least glamorous part of any Salesforce Admin’s job. Yes, there is the reset password link right beside the login button. But to many users it’s invisible. But what do you do if a user never got the initial email with a temporary password after you set up the license? What if the user swears they never got any of the Salesforce Password reset emails? Or what if it was an executive that missed the email and now needs to login? Wouldn’t it be great if Admins could just set a one-time use password?! Wouldn’t it be great to say- “I’m going to set your password to this and you can use it once to log in.”
I want you to pause for a second and click here to vote up the idea “Allow Admins to create 1-time use passwords“. Don’t vote it up because it’s my idea, that’s not why I’m linking to it. Vote it up because this ability is needed.
Until the day comes when that idea gets implemented we have to come up with a work-around.
Setting a Salesforce Users Password
Ok, before you get too far I want to warn you- there is code involved! Gasp. I know, I know, I’m a verklempt as well. Talk amongst yourselves. But it’s not that bad. So here is how we do it.
1. Log in. Click on your Your Name | Developer Console
2. The Developer Console will open, and look like the screenshot below. There is a lot going on here, but we only care about Execute area at the top.
3. Click in the “Click here to enter Apex Code” and the following pop-up will open.
4. Enter the following code, replacing USER ID with the user’s id and NEW PASSWORD with the actual text you want to change it to –
System.setPassword(‘USER ID’,’NEW PASSWORD’);
5. Click Execute.
Now, this isn’t the best solution. In fact, I contemplated even blogging about this solution because and Admin really shouldn’t know a user’s password. What this solution doesn’t do is force the user to reset their password once they log in- which I have issues with. But sometimes you need to set a user’s password and move on with your day. When I posted this idea to the IdeaExchange I was also told you can do this in Workbench as well, for anyone familiar with Workbench I’d love to have you write a Guest Post.
While it’s possible to develop tips and tricks to solve our problems in the short term, when others share those problems we need to post an idea to the IdeaExchange and vote for it. Pushing ideas on the IdeaExchange is a great way for you to get involved in the future of Salesforce.