Tom Brown
Tom Brown

Reputation: 793

Auto startup and shutdown of VMs in Hyper-V

I want to be able to automate startup and shutdown of a Windows XP VM running under Hyper-V on Windows 2008.
The VM should only be available during office hours. Its a standard Windows XP (SP3) installation. So the VM should startup at 8am and shutdown at 6pm (regardless of any running applications) according to a schedule that I can easily configure. I've looked at a batch job under the VM itself to shutdown,

(something like at 18:00 every M,T,W,Th,F shutdown /l/y/c)

but I can't work out how to get it to start up again - possibly something under Hyper-V could be used?

And it would be nice to control both startup and shutdown from the same place

Upvotes: 1

Views: 5072

Answers (1)

Marcel Glasa
Marcel Glasa

Reputation: 11

You can use Hyper-v PowerShell library from Codeplex to create your own PowerShell script to save (suspend) and start guest machines within the required time with scheduled task.

Upvotes: 1

Related Questions