Hello,
I want to start / stop my two hyper-v virtual machines in a scheduled task. I use Windows Server 2012.
For this purpose I created two cmd-scripts which calls a powershell-script.
vor64.cmd:
chcp 1252
C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe -noninteractive -nologo -command "& 'c:\batches\vor64.ps1'"
vor64.ps1
stop-vm -name "vm1" -force
stop-vm -name "vm2" -force
The nach64.cmd/nach64.ps1 looks similar only stop-vm is replaced with start-vm.
The scheduled task are konfigure to run under the administrator-account.
The scripts work fine if I start them via explorer: vm stops and start again.
They will although run fine as a scheduled task if the administrator is logged on while the task is executed. But they will not work if no user is logged on the server console.
Why?
Stefan Westner