Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I have several user logon scripts defined in active directory. These are batch scripts as well as powershell scripts.

When do these actually run? Does the user see "black terminal boxes" when he logs on, or do the scripts run while he sees the login screen?

Edit for clarification: I am speaking of logon scripts, defined in GPO and I am running Windows Server 2008 R2.

share|improve this question
Does the windows-server-2008 tag mean you are asking for the behaviour on a Server 2008 system, as opposed to this just being a server 2008 level domain? I can't answer for the behaviour on a server 2008 system, but on Windows 7, the end user (by default) doesn't see any trace of the logon script running (console or message). On Windows XP, the users sees the text Running computer start up scripts... whilst booting, but doesn't see the console window. I would guess that server 2008 would behave like Windows 7, but I'm sure someone else can confirm/deny this. – Bryan Jan 19 '12 at 10:28
Beware that startup scripts are much different from logon scripts. Startup scripts run at startup. Logon scripts run at logon. – Mathias R. Jessen Jan 19 '12 at 11:08
Sorry for being unclear, I updated my post – Heinrich Jan 19 '12 at 15:12
I've made a further edit to your question to delete the text 'Startup Scripts', just to be absolutely clear. – Bryan Jan 19 '12 at 15:18
up vote 5 down vote accepted

Logon scripts don't display a command prompt window whilst they are running by default, however it is possible to enable this behaviour via a GPO.

The logon scripts will run whilst the explorer shell is loading.

You can test the exact timing of this by adding the following to one of your scripts, which will record the time the script is run in a log file.

echo %date% %time% > %TEMP%\logon.log
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.