How to Logout all the user that are currently logged In from the Instance

ravish2
Giga Expert

I want to make sure that all the user which are currently logged in should be locked out before starting my maintenance work.

Is it possible by anyway using script or anything ?

1 ACCEPTED SOLUTION

Ravish,



It does not kick current users out but prevents them from logging back in. Used in combo with Alex's suggestion that should do what you need.



var gr = new GlideRecord('v_user_session');


gr.addEncodedQuery('user!=YOURIDHERE');


gr.query();


while(gr.next()){


gr.locked = true;


}


View solution in original post

9 REPLIES 9

Anurag Tripathi
Mega Patron
Mega Patron

Hi Ravish,



check this out


Managing User Sessions - ServiceNow Wiki



You can do the same for multiple users at a time by selecting all in the list view and using the list view action drop down to lock them out.


-Anurag

salemsap
Tera Expert

Hi Ravish,


Write a glide record against "v_user_session" table and make the record "locked" except yours and run it.


That's it.


try and let me know if any issue.




Thanks,


Alex


Matt Saxton - G
Kilo Guru

Ravish,



Checkout Maintenance mode on share..



ServiceNow Share


This app includes user logout which are currently logged in ???