3

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.

MDMarra
  • 100,734
  • 32
  • 197
  • 329
Heinrich
  • 900
  • 5
  • 21
  • 35
  • Does the [tag: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
  • 2
    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

1 Answers1

5

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
Bryan
  • 7,628
  • 15
  • 69
  • 94