User creation via script and sharing credentials
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 07:46 AM
hello Team,
I’ve created a custom table that extends the sys_user table. A user record is being generated under certain conditions via a Business Rule.
Once the user is created, I set a password programmatically and send the login credentials to the user via email.
While the password appears to be set successfully, when the user tries to log in through the ESC portal using the provided credentials, they receive an "Invalid credentials" error.
Has anyone encountered a similar issue or can offer guidance on this?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 08:00 AM
@sunilsargam or:
https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/administer/users-and-gr...
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 08:11 AM
HI @sunilsargam ,
try this
to set the user password you have use the GlideElement setDisplayvalue Method
instead of gr.user_password = pass use gr.user_password.setDisplayvalue(pass)
var gr = new GlideRecord("customTable");
if (gr.get(userSysId)) {
var pass = "test";
gr.user_password.setDisplayValue(pass)
gr.update();
}
this works but I just wanted to say this extending sys_user table is not recommended
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 07:48 AM
Hi @sunilsargam
You need to set the password in the sys_user table manually.
Unless the password is set in that record, it will not work.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 07:52 AM
Hi @Dr Atul G- LNG ,
Any workaround for this as i have to send it via email and want to do it using automation.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 07:55 AM
Hi @sunilsargam
The only thing needed is to create a password and pass it to the sys_user table.
From there, create a flow to send the password to the user.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************