Delete a Virtual Machine

Deletes a virtual machine named Scripted Machine.

VBScript Code


On Error Resume Next

Set objVS = CreateObject("VirtualServer.Application")
Set objVM = objVS.FindVirtualMachine("Scripted Machine")

errReturn = objVS.DeleteVirtualMachine(objVM)