(Just in Town)
2008-09-15 06:35 PM
Logon Script Running exe

Hi All,

We have quite a big KIX logon script being run for our users as part of group policy. I have been trying to get it to run an exe using the "Run" command which will execute our PC auditing software. When the exe is run, it sits in memory for 10mins before it begins to audit the machine.

What appears to be happening at logon is that the kix script runs and executes the auditing .exe fine, and continues through the rest of the script., but when it completes it closes and then shortly afterwards the audit .exe terminates also before it has ran the audit.

Running the same script manually after logon runs and executes perfectly, i.e. the kix script terminates but the audit exe continues to stay in memory and runs its audit.

Has anyone come across this before? Is it to do with some type of difference with the run environment when running through Group Policy or at logon? Any help would be greatly appreciated.

Thanks in advance,

(KiX Master)
2008-09-15 07:16 PM
Re: Logon Script Running exe

Can we see some code for this please.

Also not sure if it applies but as I recall the startup script has a 10 minute completion period, meaning that if what you're trying to do is not done then it will quit on it's own. I'd have to locate that exact setting but I think it was even posted here a while ago.

(KiX Master Guru)
2008-09-15 10:49 PM
Re: Logon Script Running exe


Maximum wait time for Group Policy scripts

Computer Configuration\Administrative Templates\System\Logon

This policy setting allows you to change the default script timeout period. (By default, scripts time out after 600 seconds). The range is 0 sconds to 32000 seconds.

(Seasoned Scripter)
2008-09-16 12:10 PM
Re: Logon Script Running exe

Instead of putting this in a login script, wouldn't it make more sense to make two GPOs? One, a system startup script simply checks if the audit software is installed on the system. If not, it installs it. A second GPO would tell each system to run the audit at some certain time during the day.

(KiX Master Guru)
2008-09-16 01:20 PM
Re: Logon Script Running exe

hmm... scheduled programs have the problem of needing the system be up and running at that very moment.
for my programs I've used simple run-key approach for laptops and such.

Glenn BarnasAdministrator
(KiX Supporter)
2008-09-16 01:41 PM
Re: Logon Script Running exe

Brad's pretty much on target, but with a scheduled task.. You can control what runs, the account used to run the task, and when it will run. WHEN is the real issue, so rather than taking a chance that the system is up at a certain time, create an AT STARTUP task. Task events can even be configured to run at low priority, and delete themselves when done.

I'd script in a 3-5 minute delay when the script launches, since there are lots of things going on at system startup that compete for processor resources. AT STARTUP runs tasks after the system is initialized, but at the same time that the Run and RunOnce reg keys are processed, so a short delay would make the system appear more responsive, minimizing user complaints about slowness.

Run and RunOnce reg keys are OK if the task should/can run in the user's security context. You have less control over how the task runs than through the scheduler. BTW - Win2K8 makes heavy use of the AT STARTUP capability in the scheduler.