The management console for Virtual Server is a web based tool. This poses a problem is so far as you cannot multiple select tasks for different objects in it. For example, I would like to be able to start up, shut down, etc, etc all my virtual servers at once. I would also like other collegues to be able to perform some of these example functions, without having to familiarise themselves with the Web based management console.
The answer of course is a VBScript....
Code :
On error Resume next
set ObjVS = CreateObject("virtualserver.application")
Set objVMColl = objvs.VirtualMachines
If objVMColl.Count = 0 Then
Wscript.echo "There are no Virtual Machines detected on this server"
Else
wscript.echo "Virtual Machines: " & objVMColl.Count
For each objVM in objVMColl
wscript.echo "Started: " & objVM.Name
Set subVirtualServer = CreateObject("VirtualServer.Application")
set vmVar = subVirtualServer.FindVirtualMachine(objVM.Name)
vmVar.Startup
Next
End If
Do forgive the untidiness of the script - but it does the job.
This is the same as the above script, but now with a nice pop up giving you a Yes or No option for each Virtual machine discovered.
Code :
On error Resume next
set ObjVS = CreateObject("virtualserver.application")
Set objVMColl = objvs.VirtualMachines
If objVMColl.Count = 0 Then
Wscript.echo "There are no Virtual Machines detected on this server"
Else
For each objVM in objVMColl
StrMSG="Would you like to turn on Virtual Machine: " & objVM.name
If msgbox (StrMSG, vbYesNo, "Start Virtual Machines")=vbYes THen
Set subVirtualServer = CreateObject("VirtualServer.Application")
set vmVar = subVirtualServer.FindVirtualMachine(objVM.Name)
vmVar.Startup
End If
Next
End If
Again, may be untidy, but it works. Will only work on the Virtual Server still at present. Will look into the COMDCOM stuff soon.