Hyper-V Program Manager
Due to reader demand - I am going to try and start a 'coding corner' where I talk about programming to Virtual Server's COM API. For those that don't know - Virtual Server is completely driven via COM - and anything that you want to do with Virtual Server can be done programatically.
We are going to start things off slowly with a very simple VBScript. This script will:
'Script Begins
On Error Resume Next
'Connect to Virtual ServerSet virtualServer = CreateObject("VirtualServer.Application")
'Get collection of virtual machinesset vmCollection = virtualServer.VirtualMachines
'Iterate over the virtual machines and display dataFor Each vm in vmCollection Wscript.Echo "==============================" Wscript.Echo "Name: " & vm.Name Wscript.Echo Wscript.Echo "Notes: " & vm.Notes Wscript.Echo Wscript.Echo "Configuration File: " & vm.File Wscript.Echo "Saved state file: " & vm.SavedStateFilePath Wscript.Echo Wscript.Echo "Guest OS: " & vm.GuestOS Wscript.Echo "Memory: " & vm.Memory Wscript.Echo "Undo disks enabled: " & vm.Undoable Wscript.Echo Wscript.Echo "=============================="
Next
'Script Ends
As you can see this is really quite simple - but don't worry - we will get more complex as we go on.
Cheers,Ben