Setting a Password using JavaScript

The code below can be used in a Background Script or Fix Script to reset a User’s password. The key command is to user setDisplayValue. This sets the password.





var userGr = new GlideRecord("sys_user");
userGr.get("user_name", "rtmodule");
userGr.setDisplayValue("user_password","$Douglas1$");
userGr.setValue("first_name","RT");
userGr.update();

Tagged in :

dconnell@hotmail.co.nz Avatar

Leave a Reply

Your email address will not be published. Required fields are marked *