- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2016 05:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2016 08:29 PM
Sunny,
var gr = new GlideRecord('sys_user');
//The below query will reset the password for all users whose date of password is dated more than 20 days before.Change accordingly.
gr.addQuery('u_date_of_password','<','gs.daysAgo(-20))');
gr.query();
while (gr.next())
{
gr.password_needs_reset = true;
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2016 06:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2016 08:31 AM
So the date field gets updated when the password changes, I need help with the coding in the scheduled jobs please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2016 08:37 AM
I would recommend attending our Scripting course (Scripting in ServiceNow ) since this very topic is actually covered in depth there!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2016 04:12 PM
Thanks, I will sometime later. Out of my budget right now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2016 08:29 PM
Sunny,
var gr = new GlideRecord('sys_user');
//The below query will reset the password for all users whose date of password is dated more than 20 days before.Change accordingly.
gr.addQuery('u_date_of_password','<','gs.daysAgo(-20))');
gr.query();
while (gr.next())
{
gr.password_needs_reset = true;
gr.update();
}