質問する質問する
 

回答済みScript to Turn Off all Hyper-V VMs?

回答

  • 2008年10月30日 19:04tonyso ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     回答済みコードあり
    John Kelbley provides one, you can leave feedback here or contact johnkel@microsoft.com:

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\virtualization")
    Set vmcollecion = objWMIService.ExecQuery("SELECT * FROM Msvm_ComputerSystem",,48)

    ' loop through all instances in collection
    For each vm in vmcollecion
     RequestReturn = vm.RequestStateChange(3)
    Next



    Tony Soper
    • 編集済みtonyso 2008年10月30日 19:04has code
    • 回答としてマークtonyso 2008年10月30日 19:04
    •  

すべての返信

  • 2008年10月30日 19:04tonyso ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     回答済みコードあり
    John Kelbley provides one, you can leave feedback here or contact johnkel@microsoft.com:

    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\virtualization")
    Set vmcollecion = objWMIService.ExecQuery("SELECT * FROM Msvm_ComputerSystem",,48)

    ' loop through all instances in collection
    For each vm in vmcollecion
     RequestReturn = vm.RequestStateChange(3)
    Next



    Tony Soper
    • 編集済みtonyso 2008年10月30日 19:04has code
    • 回答としてマークtonyso 2008年10月30日 19:04
    •  
  • 2008年11月24日 13:26DungKHoang ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
     You can also check my blog on Hyper-V  and PowerShell.
    I have some examples using PowerShell coding against WMI

    EnjoY!
    /Dung

    http://dungkhoang.spaces.live.com