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
Jennifer.SchnellJennifer.Schnell 

Reset User Password due to forgotten answer to security question

I have a user that cannot get into our org because he forgot his answer to his security question.  I researched online and see I can use the developer console and set my own password for him to can access and then he can change his security question/answer.  I am not too familar with the developer console or APEX code.  I am trying to use the below, but get an error "Unknown error parsing query"

SELECT System.setPassword (userID='005G00000085EnF','NEWPASSWORD')

Can anyone identify what I have wrong?  Thanks

 
FearNoneFearNone
Hi jennifer,

I am wondering why you have to do it in console.
How about in the setup→Manage Users→Users and reset his/her password there?
Irina Wittmann 7Irina Wittmann 7
Hi Jennifer, I know this answer is super late but I had the same error a while back and you're simply missing an ";" after the line of code. Shoudl work then.
David Lin 50David Lin 50
HI Jennifer, Just the following in developer console
Click on "Debug"
Select "Open Execute Anonymous Window"
Type "System.setPassword('005G00000085EnF','NEWPASSWORD');" in "Enter Apex Code"
Highlight "System.setPassword('005G00000085EnF','NEWPASSWORD');" and Select "Execute Highlighted"
The user's password with user id "005G00000085EnF" is changed to "NEWPASSWORD"
Hope this works for you !