0

Background:
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.

Wishlist:
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.

GuHa
  • 55
  • 5
  • 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
  • Would it not be simpler to just bounce the database service? – John Gardeniers Aug 11 '09 at 23:01
  • Yes, I have pondered that alternative too (NET STOP/START). However there are other backoffice applications using the database, so that's why I asked the question looking for a client alternative. – GuHa Aug 12 '09 at 06:54

2 Answers2

1

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.

Izzy
  • 8,214
  • 2
  • 30
  • 35
0

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.

JamesRyan
  • 8,138
  • 2
  • 24
  • 36