0

Windows Server 2012 R2, non domain attached, running in VMWare workstation 9.x

I would like to run a logon script to startup/resize BG Info. I have made the *.bat file, and it runs fine. I am new to logon scripts in general, so I'm sure I'm overlooking something basic.

I've created a GPO logon script object and pointed it to my *.bat file. The file ran once, on the first logon after a reboot. It will not re-run when I connect via RDP or if I connect in the VMWare console. It doesn't matter if I disconnect or if I log off the current user.

Are logon scripts supposed to on every logon? Or are there only certain times when they run?

I've done some searching on the net at large and tried disabling the logon script delay, per this MSDN article, but that didn't do what I wanted.

I've seen some articles talk about enabling synchronization, but that seems to mean the scrip will have to run and finish before explorer starts, which I don't think would be good for testing.

EDIT After the reboot, I noticed that if I log off an RDP session or the VM console and log on with the other, the script runs.

How can I get the script to run even if I didn't previously logoff?

EDIT 2

I found this article by Microsoft discussing a similar behavior, but it says that it's only for 2008 and 2008 R2.

1 Answers1

3

How can I get the script to run even if I didn't previously logoff?

A Logon script, by definition, runs at Logon. If you don't log off then the script isn't going to run again. It doesn't run on a disconnect/reconnect to an already logged on session.

joeqwerty
  • 108,377
  • 6
  • 80
  • 171
  • I would consider logging on via RDP to be a logon, regardless of whether I previously logged off or simply disconnected. It sounds like Microsoft disagrees. – YetAnotherRandomUser Nov 18 '15 at 17:28
  • 3
    `I would consider logging on via RDP to be a logon, regardless of whether I previously logged off or simply disconnected` - That's not the case. Reconnecting to an existing RDP session that you disconnected from is not logging on anew. When you disconnect from your RDP session that session is still active on the server. You have **not** logged out of that session by disconnecting from it. When you reconnect to your disconnected session you are doing just that, reconnecting to the existing session. – joeqwerty Nov 18 '15 at 17:31
  • 1
    Is there a way to run scripts when RDP connects? Is there some keyword I can look for to find the details on that? – YetAnotherRandomUser Apr 03 '16 at 14:52