Friday, May 25, 2018

Backend script to logout a user from ServiceNow - SNOW user logout script

var sessions = GlideSessions.get().getLoggedInSessionList();
var it = sessions.iterator();
while(it.hasNext()) {
var session = it.next();
if (session.getUser() == gs.getUserName()) {
var httpSession = session.getHS();
httpSession.setAttribute("locked_out", "true");
}
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.