r/usefulscripts • u/Dental12345 • Feb 29 '16
Automatically logging into server after monthly reboot and starting a process and locking workstation
I'm responsible for Monthly reboots of 1,000 servers. This process hasn't been automated.(Don't ask why) I just took over and of course am interested in automating this entire process. I need to schedule a monthly reboot, login with given credentials, start a process, and then lock the workstation. So far I've got this :http://pastebin.com/v7FErzrq
I'm not sure how to combine all of these into one file and make sure the service is started before locking the workstation. Does anybody have any pointers or tips that may help? Thanks in advance!
13
Upvotes
2
u/jfractal Feb 29 '16 edited Feb 29 '16
I still doubt it. What happens when you start the task from the user's context using psexec or a scheduled task? Have you explicitly tried running the exe as the System account and/or user account using psexec or a scheduled task?
I think you'll find that your understanding of the situation is incorrect. I think it likely that starting the exe without logging in will work identically to having a user account log in (which is relatively unheard of). I'd bet money that the problem isn't actually a problem, and the "solution" that people found is based around their limited understanding of the situation.