Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Remotely Log off a User Session

Posted on 2011-03-09
Medium Priority
Last Modified: 2012-05-11
Does anyone know of a command and/or easy process that would allow me to end a user's session via a command and/or batch process?

We have supervisors in our plants that go out onto our plant floor and potentially log in to a computer on the plant floor. Then when they get back in the office, they realize they might have forgot to log off their session on the plant floor. We only allow 1 session per user, so they have to go all the way back out to the plant before they can use their login again.

I would like to write a script of some kind that, given the user profile name, I can end that session.  The only way I could think of doing it was with the ENDJOB...but you have to know the job number, which I wouldn't know.

Any ideas?

Question by:Matthew Roessner
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2

Expert Comment

ID: 35084595
can you do any progrmming?
the users msgq will be locked.  you can use wrkobjlck or the QWCLOBJL api to determine the job info.  once you have that then ENDJOB.

Steve Bowdoin
LVL 35

Expert Comment

by:Gary Patterson
ID: 35085051
Easy interactive method:

Option 4

Scripting it is a little trickier, as Steve indicates, but WRKUSRJOB makes it so easy, there is hardly a point in going to the trouble.

- Gary Patterson

Author Comment

by:Matthew Roessner
ID: 35085138
I actually would like to come up with a programatic way of ending the user. My plan was to have a website that the enduser could go to and cilck "END SESSION" and when they clicked on that, I would submit a program via FTP remote command (or something like that).
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.


Accepted Solution

stevebowdoin earned 1000 total points
ID: 35085748
Looks like you will need to do some programming.

BTW.  Do you have exit programs protecting that FTP server?  Most sites limit sessions to 1 as a security measure.  It would be odd to allow only one session and not lock down the FTP server.  

LVL 35

Assisted Solution

by:Gary Patterson
Gary Patterson earned 1000 total points
ID: 35085875
Then you'll need to do a little coding.  What programming and scripting languages are you comfortable with?

If you know Java, then you can do it all in your web application using the JT Open library


the JobList class allows you to retrieve a list of jobs by user, and the CommandCall class lets you execute a command.

- Gary Patterson


Author Comment

by:Matthew Roessner
ID: 35086125
I ended up righting a CL program using the QWCLOBJL API.  I was able to get the program to work and then call it via FTP (using a particular user that we have set up that has authority to end jobs)

Thanks for your help

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question