Terminate Processes From All Terminal Service Users - Kill Switch?

I am wondering if it is possible to create a way to Terminate all instances of a Processes From All Terminal Service Users outside of the terminal services manager.

Scenario:
I have 11 users that run a program all day long.  
At the end of the day the program must run a (end of day) process that requires exclusive access to its MDB files.  So all users must close the program.  If they do not and close thier session with out logging off there is a ghost session and ghost instance of the program.

My users then cannot run the (end of day) process.
I am the only admin that can use terminal services manager to terminate the instances of the program.

I'd like the users to be able to terminate all instances of the program without admin privileges.

Is this possible?
LVL 1
swedishmotorsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wayne MichaelSenior Software DeveloperCommented:
It is a bad idea to kill people who might be writing or have open for write access to MDB files.

Is your software custom?  Can the software be configured to disconnect instead of killing users?
swedishmotorsAuthor Commented:
The software is not custom. I agree it should disconnect from the database and not allow connections while the process is running.

But instead I have to work around the programs inefeciecies.

So can I force the database to close all open connections.

swedishmotorsAuthor Commented:
The software is not custom. I agree it should disconnect from the database and not allow connections while the process is running.

But instead I have to work around the programs inefeciecies.

So can I force the database to close all open connections.

Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

Jim P.Commented:
I and aikimark built the VBScript in the Q below to just logoff the disconnected users. But it can probably be edited up to logoff all users that have MSAccess open. I'll ping the original Q to see if he has suggestions.

http://experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_25118303.html
aikimarkCommented:
Below is a script for walking the processes with WMI.
Source:
http://www.computerperformance.co.uk/vbscript/wmi_process.htm

==============
Possible work-around at the app level:
One thing I've done on several Access FE/BE applications is to include a form-level timer event that shuts down the application prior to the nightly data-consolidation batch job.  The one glitch is that the timer doesn't work when the PC goes into power-save mode or auto locked-out mode.  A scheduled task on the user's PC that will wake up the system should solve that problem.
' Process.vbs
' Free Sample VBScript to discover which processes are running
' Author Guy Thomas http://computerperformance.co.uk/
' Version 1.4 - December 2005
' -------------------------------------------------------' 
Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strList

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _ 
& strComputer & "\root\cimv2") 

Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process")

For Each objProcess in colProcess
strList = strList & vbCr & _
objProcess.Name
Next

WSCript.Echo strList
WScript.Quit

' End of List Process Example VBScript

Open in new window

swedishmotorsAuthor Commented:
I need more time to evaluate jimpen and aikimark solution.  I must consult with a programmer to try the code with modifications.
Jim P.Commented:
I don't think either of us really worry about points anymore. Just stay engaged in the question and we will see what we can do to help.

And none of this is rocket science. We might be able to guide you to a solution on your own.
swedishmotorsAuthor Commented:
RE: I need more time to evaluate jimpen and aikimark solution.  I must consult with a programmer to try the code with modifications.

I have contacted a programmer to compile a vbscript.  I will update asap.
Sorry, I keep getting hung up on this abandoned post when trying to post a new question.
swedishmotorsAuthor Commented:
I went with a batch file:

@echo off

echo Terminates all program's 
echo Are you sure?
pause

REM Kill all program.exe instances

FOR /F "tokens=2" %%I in ('TASKLIST ^| Find "program.exe"' ) DO (
	TASKKILL /PID %%I /F
	echo "Killed %%I"
)

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Server OS

From novice to tech pro — start learning today.