질문하기질문하기
 

답변됨Script to Start a VM?

답변

  • 2008년 10월 30일 목요일 오후 7:21tonysoperMSFT사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨코드 있음
    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
    • 답변으로 제안됨tonysoperMSFT2008년 10월 30일 목요일 오후 7:21
    • 답변으로 표시됨tonysoperMSFT2008년 10월 30일 목요일 오후 7:21
    • 답변으로 제안 취소됨tonysoperMSFT2008년 10월 30일 목요일 오후 7:21
    •  

모든 응답

  • 2008년 10월 30일 목요일 오후 7:21tonysoperMSFT사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     답변됨코드 있음
    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
    • 답변으로 제안됨tonysoperMSFT2008년 10월 30일 목요일 오후 7:21
    • 답변으로 표시됨tonysoperMSFT2008년 10월 30일 목요일 오후 7:21
    • 답변으로 제안 취소됨tonysoperMSFT2008년 10월 30일 목요일 오후 7:21
    •