views:

319

answers:

1

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

+1  A: 

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.

Marcel Glasa
You're right. I used this library. - I should have responded to Damian Powell's comment ages ago.
Tom Brown