Formular una preguntaFormular una pregunta
 

RespondidaScript to Start a VM?

Respuestas

  • jueves, 30 de octubre de 2008 19:21tonysoperMSFTMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     RespondidaTiene código
    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
    • Propuesto como respuestatonysoperMSFTjueves, 30 de octubre de 2008 19:21
    • Marcado como respuestatonysoperMSFTjueves, 30 de octubre de 2008 19:21
    • Votado como útiltonysoperMSFTjueves, 30 de octubre de 2008 19:21
    •  

Todas las respuestas

  • jueves, 30 de octubre de 2008 19:21tonysoperMSFTMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     RespondidaTiene código
    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
    • Propuesto como respuestatonysoperMSFTjueves, 30 de octubre de 2008 19:21
    • Marcado como respuestatonysoperMSFTjueves, 30 de octubre de 2008 19:21
    • Votado como útiltonysoperMSFTjueves, 30 de octubre de 2008 19:21
    •