- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2018 07:25 AM
I am going to my profile and setting the password as "password" then when I am viewing my xml then the password is shown as "$s$kq6j5hcn7xyo4xPygKRZZHt3HSBVoCzOi9vEI43c05Y=$ZC3uHQbZGeKWaWr+3aMs59+0KzAhlfY0eS3KS03Ongw="
Now suppose I am setting my password as "Xyh4g" through run script and I am viewing xml then the password is "Xyh4g".
Now the problem is that when I am trying to log in through username and password="Xyh4g" then I am not able to login,it is showing wrong username or password.Please help how can I set password through script?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2018 07:42 AM
Hi Anirban,
If you're setting a password through a script you need to use setDisplayValue('Xyh4g'). Otherwise you are setting the post-encrypted password.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2018 08:44 AM
I am using the below code in Run Script and getDisplayValue is not working.Can you help
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for( var i=0; i < 8; i++ )
text += possible.charAt(Math.floor(Math.random() * possible.length));
workflow.scratchpad.a= text;
var password= text;
var req_for=current.variables.req_for;
var gr=new GlideRecord('sys_user');
gr.addQuery("sys_id",req_for);
gr.query();
if(gr.next())
{
gr.user_password=password;
gr.password_needs_reset='true';
gr.update();
}