asifnoor
Kilo Patron

Hi,

You can create a scheduler with type script of your choosing and add below code. 

var gr = new GlideRecord("sys_user");
var gdt = new GlideDateTime();
gdt.addDays(-60);
gr.addQuery("last_login_time","<=",gdt);
gr.addActiveQuery();
gr.query();
gr.active=false;
gr.updateMultiple();

Mark the comment as a correct answer and helpful if it helps.

 

View solution in original post