How to set default password to a new users

Sathwik1
Tera Expert

How to set default password to a new user...when the user record inserted for the first time we need to set default password as "Sathwik@"

1 ACCEPTED SOLUTION

@Sathwik 

If you only want to set the default password for the users when you are loading in bulk then no need of Business rule.

you can handle this via onBefore transform script as well

Sample script below:

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

	// Add your code here

	target.user_password.setDisplayValue('Sathwik@');

})(source, map, log, target);

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

26 REPLIES 26

Jaspal Singh
Mega Patron
Mega Patron

Hi Sathwik,

 

You can use a Before Insert Business Rule that runs on User (sys_user) table as below.

find_real_file.png

 

find_real_file.pngReplace hte password as required.

Hi @Jaspal Singh 

I tried the same eariler, but password is not getting setted in the users record...is it worked for you?

Hi Sathwik - Try with the script option I have shared above and I think it will work.

Hi Sathwik - Is this resolved now?

@Sathwik - Following up on this. Let me know if that answered your question. If so, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.