Can Logoff scripts be run for over 10 minutes?
March 29, 2007 6:31 PM   Subscribe

How can I make WinXP give my Logoff script more time to complete?

My Logoff script times out too soon. I've written an Autoit executable (that automates a program using keyboard and mouse commands) and I have been trying to get it to run to completion at user logoff.

At my place of work, all users are running xp pro on their individual machines, and they log onto a domain managed by a WinNT 4.0 server. Since WinNT 4.0 does not support logoff scripting via it's group policy feature, I put a copy of my program on each machine and configured it to run as a local group policy via the gpedit.msc utility. The program ran, but it kept timing out after the default 600 seconds or 10 minutes, so I changed the Maximum Wait Time for Group Policy Scripts to 7200 and also enabled synchronous running. This has not helped (although the program does run to completion on the newer faster machines on which it needs less then 10 minutes to do its job).

Any ideas on why it stills keeps timing out after 10 minutes?
So far I have configured the machines as follows using gpedit.msc:
User Configuration\Windows Settings\Scripts (Logon/Logoff) - ADDED MY logoff script which does indeed start running at logoff
Computer Configuration\Administrative Templates\System\LogON - Run logON scripts synchronously - ENABLED
User Configuration\Administrative Templates\System\LogON - Run logON scripts synchronously - ENABLED
Computer Configuration\Administrative Templates\System\LogON - Maximum wait time for Group Policy scripts = 7200


Could the problem be that that the timeout is specified for logON scripts only? (yet there is no separate place to specify it for logOFF scripts). Or could the problem have to do with the fact that all users are logging onto a WinNT domain? Is there some setting on the WinNT server side that can override the timeout period I'm setting on the xp machines?

Thanks
posted by crack to Computers & Internet (5 answers total)
 
What are you doing in the logoff script that takes 10 minutes? I believe the setting for maximum wait time was intended for domain workstations processing group policy scripts over slow connections. If that is not the issue, you may want to re-evaluate what you're trying to do on logoff and reduce the script.

One thing to keep in mind is that the logon/logoff scripts run under the credentials of the user logged in. I usually setup scripts for startup and shutdown since they run under the local SYSTEM credentials and are less likely to run into permission issues.

In my NT4 days I was never concerned with these types of functions (as they were not even available on the workstations at the time) so I'm not that familiar with the setup (and it sounds awful by the way, you could probably pick-up a cheap copy of Windows 2000 Server online).
posted by purephase at 8:00 PM on March 29, 2007


Response by poster: Let me preface by saying: My place of work is a nonprofit organization so our budget is limited; I'm trying to work with what we have at the moment. We need to schedule our anti-virus program to run regular scans. I logged onto each machine and tried to schedule it via its scheduling wizard. I found that it would only run as scheduled while I was logged in. Furthermore, it would only run under my login (that is, the login under which it was initially scheduled). This is very limiting for two main reasons. One, most of our workstations are pretty slow, and two, we have numerous part-time workers/users with very flexible schedules that are not tied to any given machine. It would be a pain to schedule the anti-virus program to run under each person's login on every machine (although if it is doable via registry changes, a script can do that job), and it would greatly slow down the computer to have the full system scan run while a user is logged on and working.

So the easiest work around that occurred to me was to have an autoit script just run the program at logoff once a week. Users would not be responsible for running it and they would not be impeded by it in any way.

(The anti-virus program in question is Symantec's Corporate Edition. I believe the Enterprise edition includes a server side management console that would permit an administrator to schedule and run scans even when users are not logged on. However, we do not have this version and frankly, I'm not keen on requesting that we acquire it. Also: we will be migrating to Server 2003 in in about 6 months time. That may solve the problem so its not really that pressing, however, I am curious to know whether any kind of logoff script is permitted to run past 10 minutes in XP, and if so, why it will not work in my case).
posted by crack at 9:41 PM on March 29, 2007


You could call at from your logoff script to schedule a task under the SYSTEM account, and have it start immediately. That should allow windows to log off immediately. Beware of bastards like me who lock their screen, but never log off. You could also schedule a task to run every morning at 3 or so.
posted by anomie at 10:20 AM on March 30, 2007


A 10 minute logoff script will just tempt people into hitting the power switch. What I would do is create a 2 line batch file which people can run at the end of the day:

Update virus definitions
Shutdown

This has the advantage that someone needing to reboot wont be forced into a 10 minute wait.

Alternatively schedule the task to run at lunchtime using AT, if you need to minimise the performance hit so people can still work on the machine try using START /LOW
posted by Lanark at 11:39 AM on March 30, 2007


Response by poster: The script run's the scanner visibly on screen and a message is displayed letting the user know to let it do its thing. Since it has so far successfully run for 10 minutes people have seen the message and do leave it be. Also the prominent message displayed lets the user know she can abort by hitting escape in case she needs to reboot. It's just not feasible here to rely on the multitude of part-time and temp workers here to run anything on their on with regularity.

Thanks for the call AT suggestion. It would be great if that works. Will try it. I'd still be interested to know if windows allows logoff scripts to run for longer periods though.
posted by crack at 2:15 PM on March 30, 2007


« Older eBay retaliatory negative feedback retaliation   |   Negotiating Help! Newer »
This thread is closed to new comments.