How to set a password through script for USers

shaik_irfan
Tera Guru

Hello,

 

In my PDI  i am creating Users through Script but when i am passing a dummy password and trying to login it is not accepting.

 

Can anyone please help me on this.

var uc = new GlideRecord('sys_user');

uc .initialize();
uc .user_name = user_name;
uc .first_name = first_name;
uc .last_name = last_name;

uc .user_password = 'demo123';

uc.insert();

 

When i login with the password demo123 it is working

1 ACCEPTED SOLUTION

Raj68
Mega Guru

Hi irfan,

use

uc.user_password.setDisplayValue("demo123");

ex:

var gr = new GlideRecord("sys_user");

gr.get(some_sys_id);

gr.user_password.setDisplayValue("test");//useing glide Element

gr.update();

NOTE: Mark correct or helpful if it helps you.

 Warm Regards,

Raj patel

 

View solution in original post

1 REPLY 1

Raj68
Mega Guru

Hi irfan,

use

uc.user_password.setDisplayValue("demo123");

ex:

var gr = new GlideRecord("sys_user");

gr.get(some_sys_id);

gr.user_password.setDisplayValue("test");//useing glide Element

gr.update();

NOTE: Mark correct or helpful if it helps you.

 Warm Regards,

Raj patel