Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Copy and paste a script that isn't available in the manual for the paid course.

Alan42
Tera Guru

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.      

 

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@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();
}

View solution in original post

5 REPLIES 5

KowsalyaP
Tera Contributor

Hi sandeep ,

 

Please provide me also that script which I am not getting from the simulator in Task 03

KowsalyaP_0-1734593317931.png