Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have an application which uses a central database. Quite often it happens that some of the clients crashes, leaving zombies in the process table, which keeps the connection to the database. This creates problems during the nightly replication/backup process of the database.

I would like to centrally tell a specified set of workstation, some in-house and others on remote location, to run a command at a specified time that could do one of the things in the list below.

  • Run a TASKKILL command to remove the zoombie(s) from the process table.

  • if that does not help I could consider logging out the active session by force

  • Another thing we have discussed some time would be to shutdown the workstation to save energy which would also solve the problem. (The users don't appear to remember to shut down before going home)

Can this somehow be done through a Group Policy? Obviously we could set this up in the scheduler on the individual workstations, but that would not be practical. >200 wkstns across 4 countries.

We are on Windows 2003 servers and XP workstations connected in a company network.

share|improve this question
Yikes, this is a bit brutal for your clients. Can you not identify the connections to the database server and close them from the server? – squillman Aug 11 '09 at 15:55
Nope, not programatically. We have tried that first but there was no such support for that in the DB. It can be done from the GUI though. It is not really a problem since it should be performed late in the evening and no one would really be affected. At least in the first alternative. – GuHa Aug 11 '09 at 16:05
"some of the clients crashes, leaving zombies in the process table" what process table? if you're talking about stale connections to a database then set or change the idle timeout – stuart Brand Aug 11 '09 at 16:08
Agree with squillman ... closing connections really should be done server-side rather than client-side. Most DBMSs have a way to "quiesce" a database, which basically kills active connections and stops the listening. If you specify the DBMS we can likely tell you how to do it. – tomjedrz Aug 11 '09 at 16:10
I fully agree that aiming for the database is the correct approach. We have however not been able to do that. The database is Pervasive 7.51 – GuHa Aug 11 '09 at 16:14
up vote 1 down vote accepted

This can't really be done through Group Policy.

There are several ways to skin this cat. If it was me, I'd script the whole thing in VBScript. It would parse through a text file full of workstation hostnames, first killing the zombie process(es), and then forcing a logout. You could also make it shutdown the machine in question. However, I am not sure on your competency with VBScript so I'll just leave you with the idea.

What would probably be much easier is to make a batch file using some built-in Windows commands. This would involve use of these commands:

taskkill /S hostname /IM imagename /F /T

logoff [sessionid] /SERVER:hostname

shutdown /M hostname /F

You would then run this batchfile from anywhere and it would operate remotely on the machines in question.

share|improve this answer

you can add scheduled tasks in script.

So one answer would be to write a script that adds a scheduled task, then rollout the script across all the workstations using group policy.

Another way would be to run a command using pstools. You can add multiple computer names to a command and save that in a batch file. This would mean listing them all once though.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.