- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2020 08:32 PM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2020 08:40 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2020 10:03 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2020 07:41 AM
Thanks for the info. Any recommendation on how to send an email to the user with a password?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2020 07:48 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2020 08:05 AM
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