I don’t want my Hyper-V server powered on all night, so this is my part to save our planet
First of all I needed a service account, granted only the permissions needed.
Service account Name: svc-shutdown (enabled: password never expires)
Then, I created a Group Policy to grant this account shutdown permissions (locally and remote, probably only these remote permissions are needed) and to log on as a batch job.
After linking the GPO to the OU’s where needed, I created a Scheduled Task to run a batch file:
Let’s say run at 1AM:
And run this batch file:
The batch file does need some improvement, but that’s for later:
shutdown /m \\server1 /s /f
shutdown /m \\server3 /s /f
shutdown /m \\server242 /s /f