Logon scripts do not run at logon – Server 2012 R2

Another genius bit of fiddling by Microsoft means that on Server 2012 R2 and Windows 8.1, logon scripts no longer run as part of the logon process. This had me totally foxed for hours. I have my logon script configured via Group Policy.

I believe that it is only GPO configured scripts that are affected, if you’re using the oldskool Active Directory user account configuration then it seems like the scripts keep running as expected whilst the logon process runs through.

If they’re configured via GPO, the new default setting is to run them five minutes after logon. This makes the logon process nice and speedy – shame it leaves your environment potentially unusable for the user…

Anyway, eventually I came across this policy setting that allows you to make it work how it used to (and how you probably expected it to):

Setting Path: Computer Configuration/Administrative Templates/System/Group Policy
Setting Name: Configure Logon Script Delay
Supported On: At least Windows Server 2012 R2, Windows 8.1 or Windows RT 8.1
Explanation
Enter “0” to disable Logon Script Delay. This policy setting allows you to configure how long the Group Policy client waits after logon before running scripts. By default, the Group Policy client waits five minutes before running logon scripts. This helps create a responsive desktop environment by preventing disk contention. If you enable this policy setting, Group Policy will wait for the specified amount of time before running logon scripts. If you disable this policy setting, Group Policy will run scripts immediately after logon. If you do not configure this policy setting, Group Policy will wait five minutes before running logon scripts.

This entry was posted in Scripting, Windows and tagged , , , , , , , . Bookmark the permalink.

23 Responses to Logon scripts do not run at logon – Server 2012 R2

  1. Gerjan says:

    Thanks for this article. I just spend two hours figuring out why my scripts are not running. I set the GPO for a 0 delay and all is working now.

  2. Dave Harris says:

    Thank you, wish I had found this article 3 hours ago!

  3. Z says:

    Thanks for this post. I was going insane.

  4. Pingback: Windows 8.1 and Server 2012 R2 Logon Script Delay | dave.harris.uno

  5. CatHat says:

    Why on earth did Microsoft implement this as a default setting? Does Microsoft actually use their own products? Like everyone else, wasted hours.

    Thanks for the article, straight to the point :)

  6. Jared Bratu says:

    I too wasted a couple hours trying to figure out why my logon group policy scripts weren’t running in a new Server 2012 environment. Thanks for posting it, your article saved me a lot of head scratching. Just to clarify the path to the group policy setting is “Computer Configuration\Administrative Templates\System\Group Policy”

  7. Hi Guys, I have just found this article after going absolutely NUTS trying to work out why a very simple script of mine wouldn’t run (on our 2012R2 boxes)! … then timed it, exactly 5 minutes.
    Only problem, i can’t find the GPO setting you refer to (this is on a 2012R2 AD primary DC) :( … a lot of group policy settings, but not that particular one… any ideas?

    • rcmtech says:

      Might be a problem with your Central Store for Group Policy Administrative Templates – there might be some stuff missing from that?

      • Yep, soon after posting that I foudn the central store hadn’t been updated :)
        Now have the GPO applying, albeit the setting still isn’t effective (but is applying). Going to dig deeper this morning on it. CHeers

  8. Robin Geunes says:

    Thanks!

  9. sdevriesnl says:

    THX!

  10. Nam says:

    Terrific! Thank you very much.

  11. Pingback: GPL Loginscripte werden erst nach 5 Minuten ausgeführt | Tobias Schneider

  12. jegors.firsovs@runway.lv says:

    Thanks man! a+++

  13. kevin says:

    thk’s saved my day

  14. Frank says:

    Please help, logon script will still not work after changing that setting, will work on other servers that are in the same OU. Look like there is major problem with server 2012 R2

    • rcmtech says:

      Hi, I think this is probably something you’ve done (or not done). Logon scripts can and do work on Windows Server 2012. If you’d like help, click the “Hire Me” link at the top of the page.

    • Tony C says:

      Frank, did you ever find a solution to this? I’m in the same boat as you. I’m running a powershell script to remove Windows App’s in Win10. But it takes 5+ minutes before it runs, even after I’ve disabled this GPO.
      Thanks,

  15. Pingback: Logon Scripts Not Running | Just Trying to Keep Up

  16. RP says:

    Typical morons at Microsoft not thinking things through. This change was no doubt implemented to fix a symptom rather than a problem. What kind of idiot would think that implementing a delay before running a script would make things easier / better for those people that have stuff that absolutely needs to run *at* logon. Not five minutes later. Words fail me.

  17. Tim says:

    I configured a GPO with logon and logoff scripts, and set the Configure Logon Script Delay GPO setting to Enabled with the setting of zero (I also tried setting it to Disabled), but the scripts still wait five minutes to run. When I run RSOP on the server I am logged into the Logon scripts show, but the Configure Logon Script Delay does not listed, so it is not getting applied. Computer policy is Enabled in the GPO. Computer policies from other GPOs show in RSOP. What would keep the Configure Logon Script Delay from getting applied to the server? The domain controller and domain level are Windows Server 2012 R2. The server I’m logged into is server 2012 R2.

    • rcmtech says:

      I can guarantee that this works on Server 2012 R2. If the policy setting isn’t being applied then you need to diagnose that as a completely separate issue.

  18. Pingback: Windows 2012 : les scripts d'ouverture de session ne se lancent pas

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s