Categories
Welcome Center
Education & Development
Discussions
Certification Preparation
Recent Posts
Groups
Free Resources
Ebooks
Free Workshops
Trending Certifications Infographic
Infosec Training
IT & Security Training
Live Boot Camps
Security Awareness Training
About Infosec Institute
Home
Discussions
Off Topic
Logon script for terminating an idle application.
albanga
Hello all,
I was wondering if anyone can assist with a little problem i am having. We are currently running an application that is low on licenses. Many times a day we have to send out messages to staff to tell them to log off if they are not using the application. The easiest way to fix this is to obviously buy new licenses. The problem is that we are making this program redundant soon and it is onyl be used at present until the implementation of the new one. So management arent to keen to spend $50,000 on these.
So what i would like to do to make life a little easier for myself and the staff is to run a logon script that sees when an application has been sitting idle for around 30 minutes at which time it will end the process. The problem is that im useless at script writing and cant find anything really solid on the internet to assist.
So what i guess im asking is if anyone knows of a script that could do this? And if so could you please post it so i can copy and make the neccessary changes.
It will need to be a logon script running in a terminal services enviroment, or if there is another way to do it im all ears.
Thanks in advance!
Find more posts tagged with
Save $250 on 2025 certification boot camps from Infosec!
Book now with code EOY2025
Button
Comments
sprkymrk
The trick to that one is how to find out if the process is idle. It would be easy just to see if it was running, and if so kill it. Another question I have is this - If the program runs under a "user" context, why does it continue to run once the user logs off?
blargoe
One quick and dirty way that might work: if it runs from a network file share, you can go into the computer management console on the server and kill any open connections to that share or to that .exe depending on your preference.
albanga
Sorry should have been clearer.
When the user logs off it does end the session. The problem is we have users who run this application, they do what they need to do and then they go off on client visits or lunch or whatever really but leave the application opened.
So it is sitting there open and using a license. I could open terminal services manager and find the idle processe and terminate them but i honestly dont have the time to keep on checking this (who would). So what i was hoping for is a script that sais something like;
if adapt.exe = idle 60mins "terminate"
As i said i dont write scripts as you can see but hopefully you understand what i am saying. Maybe you wouldnt even run the login script on the users profile perhaps you could run it as a logon script on each terminal server.
Like i said im really in the dark on this one and was hoping someone might have had a similar problem. As sprkymrk said i think the key is to find out the idle process and eliminate it.
Darthn3ss
not related to logon scripts but tell the users that management has informed you that if you can not get this licensing problem fixed they will take cost by eliminating paid vacations for all employees who have been working for the company for less than 12 years.
sprkymrk
What is the program you want to kill, a custom app?
How do you, as an admin, see that it is idle?
Does the process run on the client or terminal server?
JDMurray
I don't believe that the 32-bit Windows OS has the concept of "process idle time" like UNIX does. I've been looking through all of the information displayed by the Process Explorer and Process Monitor utilities from
www.sysinternals.com
and I don't see anything that indicates states such as "active" and "idle" or "idle time."
From a software point of view, the program could expose an API which allows another process run from a script to query the program as to when the user last interacted with it. If no such API exists, then I would write a monitor program which launches the first program as a child process and watches it for user mouse and keyboard input. After a specific period of time has passed where no user input has been received, the monitor program will kill the child process. It seems reasonable to think that such utility programs are already available.
Ahriakin
Still requires coding but you could generate a kind of screensaver that blanks the screen but also kills that process if it exists, set it through Policy (or whatever) as the default screensaver for whatever idle time you wish. This has windows is using it's own idle/screensaver timer to schedule the process-kill.
blargoe
If it's running under Terminal Server, you can log on the server and go into Terminal Services Configuration under administrative tools. From there you can easily set an idle timeout period for the connection. As long as tell it to log off and not simply disconnect after the idle period, it will close the application and the user will be logged off.
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of
INFOSEC Boot Camps
$250
OFF
Use code
EOY2025
to receive $250 off your 2025 certification boot camp!
BROWSE BOOT CAMPS