none
Script to Start a VM?

Answers

  • John Kelbley has provided one. Leave feedback here or you can e-mail johnkel@microsoft.com/ 

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\virtualization")
    ' Obtain an instance of the the class
    ' using a key property value.


    "select * from Msvm_ComputerSystem where elementname ="  +"'" + $virtualguest + "'"


    Set objShare = objWMIService.Get("Msvm_ComputerSystem.CreationClassName='Msvm_ComputerSystem', ElementName='CCS V1 Head'")
    Set objInParam = objShare.Methods_("RequestStateChange").inParameters.SpawnInstance_()
    objInParam.Properties_.Item("RequestedState") =  2
    Set objOutParams = objWMIService.ExecMethod("Msvm_ComputerSystem.CreationClassName='Msvm_ComputerSystem', ElementName='CCS V1 Head'", "RequestStateChange", objInParam)


    tony soper
    • Proposed as answer by tonysoper_MSFT Thursday, October 30, 2008 7:21 PM
    • Marked as answer by tonysoper_MSFT Thursday, October 30, 2008 7:21 PM
    • Unproposed as answer by tonysoper_MSFT Thursday, October 30, 2008 7:21 PM
    Thursday, October 30, 2008 7:21 PM