New User Email Notification - Password Starred Out

dwoods
Giga Contributor

I have an email notification setup to send an email to a newly created user. In that email it provides them with their username and password.

User ID: ${user_name}
Password: ${user_password}

The password always shows as ******* in the email. Any way to get this to show the plain text version of the password? We have it set so these new users have to change their password on login.

 

Thanks

 

1 ACCEPTED SOLUTION

You should explore Password Reset application which is OOB.

 

The  Password Reset application enforces strong and secure passwords by enabling end users to reset or change their passwords either by self-service process or by taking the help of a service desk agent.

 

Regards,

Sachin

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@dwoods 

user_password field on sys_user table is Password (1 way encrypted) type which means you cannot decrypt it using script.

'password2' field types are allowed to be decrypted

Regards
Ankur

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

Thanks for the info. Any recommendation on how to send an email to the user with a password?

@dwoods 

you can create a password 2 field and store the user password there once user is created

then you can decrypt it and show in email

considering your notification is on sys_user table; the below should work in email script to show the plain password

var Encrypter = new GlideEncrypter(); 
var encrypted = current.<fieldName>; // your new field name here
var decryptedValue = Encrypter.decrypt(encrypted);  

template.print('User password'+decryptedValue);

Regards
Ankur

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

sachin_namjoshi
Kilo Patron
Kilo Patron

You should not be sending passwords in email to any user since it's a big security risk for your org.

How are you pulling user data? Are you pulling users records from Active directory?

Ideally, AD team should be doing setup for new users and use secure platforms like OKTA verify, Pulse secure etc to help them for initial login.

 

Regards,

Sachin