[gptalk] Re: logon scripts not running

  • From: "Darren Mar-Elia" <darren@xxxxxxxxxx>
  • To: <gptalk@xxxxxxxxxxxxx>
  • Date: Wed, 6 Dec 2006 07:05:21 -0800


The funny thing about scripts policy is that the running of the script
itself is actually totally disconnected from Group Policy processing. All
the Scripts CSE does is collect the information on which logon scripts it
needs to run during GP processing. That information is stored in the
registry and then I believe it's the Userinit process that runs the logon
script during logon. Typically logon scripts won't run for any number of
reasons, depending upon what they are doing and other things like the timing
of the network stack coming up, etc. What I usually suggest is to put some
kind of logging into your script to find out on which line it stops running
(or if its running at all). For example, in a batch file, the simplest way
to do that might be as below:


Echo y | Net use * /d  > %temp%\log.txt

Net use p: \\myserver\public <file:///\\myserver\public>  >> %temp%\log.txt



So you get the output of each line in the file and you can look at log.txt
to see what happened. 


Let us know if you need more info.



From: gptalk-bounce@xxxxxxxxxxxxx [mailto:gptalk-bounce@xxxxxxxxxxxxx] On
Behalf Of Jeremy Hagan
Sent: Tuesday, December 05, 2006 5:01 PM
To: gptalk@xxxxxxxxxxxxx
Subject: [gptalk] logon scripts not running


Hello All,


Ever since I have been putting in AD (since 2002) I have noticed the problem
where GPO logon scripts intermittently don't run.  I've never bothered
troubleshooting it since it is so intermittent and not repeatable.  I work
for a systems integration company so I'm not talking about 1 AD, but many. 


Anyway, I'm currently working at a site that has been having this problem
since they put in AD about 2.5 years ago and I've taken up the challenge to
solve it.


The domain is Windows 2003, native domain and forest, that has been upgraded
from Windows 2000 AD, but no DCs remain that ever ran Windows 2000.


The login script is a VBscript that runs from a general purpose user policy
that has settings in folder redirection, and Admin Templates, but not in IE


We have added a second logon script that is just a batch file that logs the
fact that the script ran to a text file.


When the vbscript fails to run, the batch file also fails to run.


*       We have disabled Group Policy Slow Link Detection
*       We have enabled the "Allow processing across a slow network
connection" under the "Scripts Policy Processing" option
*       We have enabled the "Process even if the Group Policy objects have
not changed" under the "Scripts Policy Processing" option

Servers run WS03 SP1 and clients run WinXP SP2.


We have enabled userenv logging and I can see that policy processing is
occuring for the particular policy that has the logon script, it just isn't
running the script.


I have set up a batch file in the startup folder that detects the absence of
a mapped drive and collects the Userenv.log, the last 100 System and
Application Event log entries, and a few regitry keys and other log files as
well as emailing me to let me know it fired off. 


A sample userenv.log can be provided on request.  Over to you guys!!




Other related posts: