Script to Turn Off all Hyper-V VMs? Need a script to Turn Off all the VMs running on a server with the Hyper-V role enabled?<hr size="1" align="left" width="25%">Tony Soper© 2009 Microsoft Corporation. All rights reserved.Mon, 24 Nov 2008 13:26:50 Zaabae10f-74e1-4a33-a50f-4a26620b21b0http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/aabae10f-74e1-4a33-a50f-4a26620b21b0#aabae10f-74e1-4a33-a50f-4a26620b21b0http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/aabae10f-74e1-4a33-a50f-4a26620b21b0#aabae10f-74e1-4a33-a50f-4a26620b21b0tonysohttp://social.technet.microsoft.com/Profile/en-US/?user=tonysoScript to Turn Off all Hyper-V VMs? Need a script to Turn Off all the VMs running on a server with the Hyper-V role enabled?<hr size="1" align="left" width="25%">Tony SoperThu, 30 Oct 2008 19:02:26 Z2008-10-30T19:02:26Zhttp://social.technet.microsoft.com/Forums/en-US/ITCG/thread/aabae10f-74e1-4a33-a50f-4a26620b21b0#c63819dd-3d14-40fe-9b5a-f8438fe46b17http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/aabae10f-74e1-4a33-a50f-4a26620b21b0#c63819dd-3d14-40fe-9b5a-f8438fe46b17tonysohttp://social.technet.microsoft.com/Profile/en-US/?user=tonysoScript to Turn Off all Hyper-V VMs? John Kelbley provides one, you can leave feedback here or contact <a href="mailto:johnkel@microsoft.com">johnkel@microsoft.com</a>:<br> <p>strComputer = &quot;.&quot; <br>Set objWMIService = GetObject(&quot;winmgmts:\\&quot; &amp; strComputer &amp; &quot;\root\virtualization&quot;) <br>Set vmcollecion = objWMIService.ExecQuery(&quot;SELECT * FROM Msvm_ComputerSystem&quot;,,48) </p> <p>' loop through all instances in collection<br>For each vm in vmcollecion<br> RequestReturn = vm.RequestStateChange(3)<br>Next<br></p><br> <hr align=left width="25%" size=1> Tony SoperThu, 30 Oct 2008 19:04:21 Z2008-10-30T19:04:31Zhttp://social.technet.microsoft.com/Forums/en-US/ITCG/thread/aabae10f-74e1-4a33-a50f-4a26620b21b0#c528434e-7503-4f07-a3e1-ffc985e1febdhttp://social.technet.microsoft.com/Forums/en-US/ITCG/thread/aabae10f-74e1-4a33-a50f-4a26620b21b0#c528434e-7503-4f07-a3e1-ffc985e1febdDungKHoanghttp://social.technet.microsoft.com/Profile/en-US/?user=DungKHoangScript to Turn Off all Hyper-V VMs? You can also check my blog on Hyper-V  and PowerShell.<br>I have some examples using PowerShell coding against WMI<br><br>EnjoY!<br>/Dung<br><br><span class=RadEWrongWord>http</span>://<span class=RadEWrongWord>dungkhoang</span>.spaces.live.com<br><br>Mon, 24 Nov 2008 13:26:11 Z2008-11-24T13:26:48Z