We help IT Professionals succeed at work.

GPO deployed but startup script from GPO not running?  Need to debug.

53 Views
Last Modified: 2020-09-17
I started this here: https://www.experts-exchange.com/questions/29176454/GPO-to-schedule-Windows-restarts.html
I have a GPO that uses a Startup script.
The Startup script runs a .bat file.
The .bat file creates a folder in C:\Users\Public\ called Scripts if it doesn't exist.
The .bat file writes a .bat file into Scripts: "reset.bat" which is simply:
shutdown -r

Open in new window

The .bat file runs schtask:
schtasks /create /TN "reset" /RU "NT AUTHORITY\SYSTEM" /IT /RL HIGHEST /SC DAILY /st 16:00 /TR C:\Users\Public\Scripts\reset.bat

Open in new window


On the initial tests that I ran, it appeared that this was working fine - both on a small group and then on  couple of larger groups of computers.
However, in fully deploying the GPO, I now see that a fair number of the added computers have the GPO applied but the .bat file and the scheduled task don't exist.

I'm trying to figure out how to best debug this situation.  Adding some kind of logging to the startup script running seems likely.  But how?  I've not found it.
Comment
Watch Question

System Administrator
CERTIFIED EXPERT
Distinguished Expert 2018
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Fred MarshallPrincipal
CERTIFIED EXPERT

Author

Commented:
I had tried to use that latter interface but it seems that the runas section is all grayed out when setting up the GPO.
I understand this is due to a recent Windows security update.  Thus the startup script.  It should be pretty simple really.
And, it *does* work on many of the computers.  So I need to debug the ones that don't work somehow.
Fred MarshallPrincipal
CERTIFIED EXPERT

Author

Commented:
It seems that those computers that hadn't worked yet just needed a reboot.  Odd that some did and some didn't.....

Thanks for the help!
Fred MarshallPrincipal
CERTIFIED EXPERT

Author

Commented:
Thanks again.  I'll keep the server script idea in mind!
Hello ThereSystem Administrator
CERTIFIED EXPERT
Distinguished Expert 2018

Commented:
You are welcome!
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.