Ben Armstrong and John Howard swoop in with another Microsoft Virtual Server code tip!
Do you want to learn how to programmatically change the boot order of a virtual machine's BIOS? Ben explains this is accomplished by using GetConfigurationValue and SetConfigurationValue, two powerful and useful APIs.
The following script takes two virtual machines as command line parameters and copies the BIOS configuration from one to the other.
Set vs = CreateObject("VirtualServer.Application")
set vm1 = vs.FindVirtualMachine(WScript.Arguments(0))
set vm2 = vs.FindVirtualMachine(WScript.Arguments(1))
key = "hardware/bios/cmos"
result = vm2.SetConfigurationValue(key, vm1.GetConfigurationValue(key))
Ben notes that the reason he copies between machines rather than loading a preconfigured value is because the CMOS key is actually a byte value and is difficult to manage under VBScript.
Visit Ben's original article to comment.