- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2023 06:46 AM
The Evantage lab guide says to copy and paste a script that isn't available in the manual for the paid course. Specifically to check the KB for text. There's nothing in the ServiceNow knowledge base for cleanup scripts. Where am I supposed to go for this and other mandatory information? Right now I am stuck on Lab 1.2 Clone an instance., step D. Student (source) Instance: Create Cleanup Scripts.
This is the ServiceNow Administration Advanced course.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2023 08:20 AM
@Alan42 If you are just looking for the script then here it is.
var gr_lock_out_non_admins = new GlideRecord("sys_user");
gr_lock_out_non_admins.addEncodedQuery("roles!=admin");
gr_lock_out_non_admins.query();
while (gr_lock_out_non_admins.next()) {
gr_lock_out_non_admins.locked_out = true;
gr_lock_out_non_admins.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2023 08:20 AM
@Alan42 If you are just looking for the script then here it is.
var gr_lock_out_non_admins = new GlideRecord("sys_user");
gr_lock_out_non_admins.addEncodedQuery("roles!=admin");
gr_lock_out_non_admins.query();
while (gr_lock_out_non_admins.next()) {
gr_lock_out_non_admins.locked_out = true;
gr_lock_out_non_admins.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2023 08:25 AM
Thank you. Do you know where this is documented? I don't know if there are similar copy and paste scenarios later on in the course.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2023 12:14 PM
@Alan42 Sorry no documentation is available with me. If similar scenario occurs then create a post and tag me in the same along with the screenshot. I will extract the code for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2023 03:55 AM