-- Ben Armstrong, Virtualization Program Manager
Talking about core virtualization at Microsoft (Hyper-V, Virtual PC and Virtual Server).
Virtual Server allows you to configure virtual machines to startup automatically when the host system boots. However in order to enable this feature you need to configure a user account to run the virtual machine under first (as when the host system boots there is no available user session to run the virtual machine under). Below is a script that will configure a virtual machine to start automatically when the host system boots - if it was running when the host system shutdown:
Set objVS = CreateObject("VirtualServer.Application")Set objVM = objVS.FindVirtualMachine("VM Name")objVM.RunAsDefinedAccount = Trueresult = objVM.SetAccountNameAndPassword("DOMAIN\Username","Password")objVM.AutoStartAtLaunch = 2
If you want the virtual machine to always start (whether it was running before or not) you should set AutoStartAtLaunch to 1.
Cheers,Ben
Hello!
This seems interesting and exactly what I am looking for now. But would it work in Windows Hyper-V Server 2008 R2 ?