Force Logout Users in all Nodes

D_8
Tera Contributor

I have a business rule that is trying to force Logout users using the below script 

var gr = new GlideRecord('v_user_session');
gr.addEncodedQuery('user=YOURIDHERE');
gr.query();
while(gr.next()){
  gr.locked = true;
}

But the problem is in production we have around 12 nodes, and the above script works logs out users from a specific node that is assigned at the time but all nodes. If my user is in Node A, and when the business rule runs under another user who is in Node B, then the script wont logout the user. Node assignment seems to be random.

Any Idea how to solve this ?