<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Set-SoftPowerOff</title>
	<atom:link href="http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/</link>
	<description>Using Powershell for (virtually) everything!</description>
	<lastBuildDate>Fri, 27 Aug 2010 15:06:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: DGlynn</title>
		<link>http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/comment-page-1/#comment-393</link>
		<dc:creator>DGlynn</dc:creator>
		<pubDate>Fri, 17 Oct 2008 14:44:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/#comment-393</guid>
		<description>Thanks Hugo, and thanks for pointing me at the right cmdlet :)</description>
		<content:encoded><![CDATA[<p>Thanks Hugo, and thanks for pointing me at the right cmdlet :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/comment-page-1/#comment-389</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 17 Oct 2008 05:39:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/#comment-389</guid>
		<description>Okay, here&#039;s how to check the setting before modifying it:
function Set-SoftPowerOff
{
	param($VMs)
	ForEach ($VM in $VMs)
	{
	$VMadv = $VM &#124; Get-View
	If ($VMadv.Config.DefaultPowerOps.DefaultPowerOffType -ne &quot;soft&quot;)
	{
		$VMConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
		$VMConfigSpec.PowerOpInfo = New-Object VMware.Vim.VirtualMachineDefaultPowerOpInfo
		$VMConfigSpec.PowerOpInfo.PowerOffType = &quot;soft&quot;
		$VMadv.ReconfigVM($VMConfigSpec)
	}
	}
}</description>
		<content:encoded><![CDATA[<p>Okay, here&#8217;s how to check the setting before modifying it:<br />
function Set-SoftPowerOff<br />
{<br />
	param($VMs)<br />
	ForEach ($VM in $VMs)<br />
	{<br />
	$VMadv = $VM | Get-View<br />
	If ($VMadv.Config.DefaultPowerOps.DefaultPowerOffType -ne &#8220;soft&#8221;)<br />
	{<br />
		$VMConfigSpec = New-Object <a href="http://www.vmware.com/" target='_blank'>VMware</a>.Vim.VirtualMachineConfigSpec<br />
		$VMConfigSpec.PowerOpInfo = New-Object <a href="http://www.vmware.com/" target='_blank'>VMware</a>.Vim.VirtualMachineDefaultPowerOpInfo<br />
		$VMConfigSpec.PowerOpInfo.PowerOffType = &#8220;soft&#8221;<br />
		$VMadv.ReconfigVM($VMConfigSpec)<br />
	}<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/comment-page-1/#comment-388</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 17 Oct 2008 05:34:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/#comment-388</guid>
		<description>Great suggestion, working on it right now. I&#039;ll post it when it&#039;s finished.
The Stop-VM cmdlet will always do a hard power off. You can use Shutdown-VMGuest for a sof power off. We are only changing the behaviour of the Power Off button from Stop-VM to Shutdown-VMGuest.</description>
		<content:encoded><![CDATA[<p>Great suggestion, working on it right now. I&#8217;ll post it when it&#8217;s finished.<br />
The Stop-VM cmdlet will always do a hard power off. You can use Shutdown-VMGuest for a sof power off. We are only changing the behaviour of the Power Off button from Stop-VM to Shutdown-VMGuest.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DGlynn</title>
		<link>http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/comment-page-1/#comment-386</link>
		<dc:creator>DGlynn</dc:creator>
		<pubDate>Thu, 16 Oct 2008 19:00:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/#comment-386</guid>
		<description>Suggestion, can you have your function check the value of PowerOffType and not make the change and call ReconfigVM again if it is already set to &quot;soft&quot;.

I did find that it has changed the behavior of the Power Off button in VIC, but the Stop-VM cmdlet still calls a hard power off.</description>
		<content:encoded><![CDATA[<p>Suggestion, can you have your function check the value of PowerOffType and not make the change and call ReconfigVM again if it is already set to &#8220;soft&#8221;.</p>
<p>I did find that it has changed the behavior of the Power Off button in VIC, but the Stop-VM cmdlet still calls a hard power off.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VMware: Set Soft Power Off The Easy Way &#171; ICT-Freak</title>
		<link>http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/comment-page-1/#comment-226</link>
		<dc:creator>VMware: Set Soft Power Off The Easy Way &#171; ICT-Freak</dc:creator>
		<pubDate>Thu, 11 Sep 2008 16:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/#comment-226</guid>
		<description>[...] te passen. Dit kun je ook via Powershell doen. Hugo Peeters heeft daar een blogpost over gemaakt http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/. Hoe je dit script kunt gebruiken lees je in deze [...]</description>
		<content:encoded><![CDATA[<p>[...] te passen. Dit kun je ook via <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" target='_blank'>Powershell</a> doen. Hugo Peeters heeft daar een blogpost over gemaakt <a href="http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/" rel="nofollow">http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/</a>. Hoe je dit script kunt gebruiken lees je in deze [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Excellent (VI) Powershell Scripts &#171; ICT-Freak</title>
		<link>http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/comment-page-1/#comment-200</link>
		<dc:creator>Excellent (VI) Powershell Scripts &#171; ICT-Freak</dc:creator>
		<pubDate>Fri, 05 Sep 2008 20:50:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/#comment-200</guid>
		<description>[...] Set-SoftPowerOff [...]</description>
		<content:encoded><![CDATA[<p>[...] Set-SoftPowerOff [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jfk8680</title>
		<link>http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/comment-page-1/#comment-165</link>
		<dc:creator>jfk8680</dc:creator>
		<pubDate>Fri, 29 Aug 2008 11:35:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/#comment-165</guid>
		<description>Hugo,

It worked flawlessly. Thanks for taking me through it step by step. This is really a powerfull way to manage a virtual infrastructure. Great stuff!!

Jeffrey</description>
		<content:encoded><![CDATA[<p>Hugo,</p>
<p>It worked flawlessly. Thanks for taking me through it step by step. This is really a powerfull way to manage a virtual infrastructure. Great stuff!!</p>
<p>Jeffrey</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/comment-page-1/#comment-164</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 29 Aug 2008 09:29:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/#comment-164</guid>
		<description>Hi Jeffrey,
Welcome to my blog!
To use this script, first save it to disk.
Then start Powershell / VI Toolkit.
run the script by typing the full path to the script file (use TAB for autocomplete). NOTE: you should precede the path with a dot and a space (it&#039;s called Dot-Sourcing and allows you to use the scripts functions and variables after closing the script), e.g.: . &quot;d:\scripts\Set-SoftPowerOff.ps1&quot; . No output is shown.
Connect to VC: Connect-VIServer &quot;MyVCServer&quot;.
Then get the vms you want to run against, e.g.: $MyVMs = Get-VM to get all vms or $SomeVM = Get-VM &quot;MyVMName&quot;.
Then run the function, feeding it the collection of vms: Set-SoftPowerOff $MyVMs.

Alternatively, you could edit the script and put the commands I listed above into the file itself. Then you could run the script by typing the path to the script.

Hope that clarifies things for you. If not, please respond.

Hugo</description>
		<content:encoded><![CDATA[<p>Hi Jeffrey,<br />
Welcome to my blog!<br />
To use this script, first save it to disk.<br />
Then start <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" target='_blank'>Powershell</a> / <a href="http://www.vmware.com/sdk/vitk_win/index.html" target='_blank'>VI Toolkit</a>.<br />
run the script by typing the full path to the script file (use TAB for autocomplete). NOTE: you should precede the path with a dot and a space (it&#8217;s called Dot-Sourcing and allows you to use the scripts functions and variables after closing the script), e.g.: . &#8220;d:\scripts\Set-SoftPowerOff.ps1&#8243; . No output is shown.<br />
Connect to VC: Connect-VIServer &#8220;MyVCServer&#8221;.<br />
Then get the vms you want to run against, e.g.: $MyVMs = Get-VM to get all vms or $SomeVM = Get-VM &#8220;MyVMName&#8221;.<br />
Then run the function, feeding it the collection of vms: Set-SoftPowerOff $MyVMs.</p>
<p>Alternatively, you could edit the script and put the commands I listed above into the file itself. Then you could run the script by typing the path to the script.</p>
<p>Hope that clarifies things for you. If not, please respond.</p>
<p>Hugo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jfk8680</title>
		<link>http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/comment-page-1/#comment-163</link>
		<dc:creator>jfk8680</dc:creator>
		<pubDate>Fri, 29 Aug 2008 09:13:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.peetersonline.nl/index.php/vmware/set-softpoweroff/#comment-163</guid>
		<description>Hi Hugo,

I&#039;m pretty new to this scripting stuff ;-). I&#039;ve installed powershell and the VI toolkit and can run basic commands such as Get-VM succesfully. 

Could you please explain how I can run this script so it modifies all my VMs??  I promise I&#039;l dive into the powershell documentation asap but  I&#039;m in need of bit of a quick fix at the moment ;-)

Thanks a lot for your help!

Jeffrey</description>
		<content:encoded><![CDATA[<p>Hi Hugo,</p>
<p>I&#8217;m pretty new to this scripting stuff ;-). I&#8217;ve installed <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" target='_blank'>powershell</a> and the <a href="http://www.vmware.com/sdk/vitk_win/index.html" target='_blank'>VI toolkit</a> and can run basic commands such as Get-VM succesfully. </p>
<p>Could you please explain how I can run this script so it modifies all my VMs??  I promise I&#8217;l dive into the <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" target='_blank'>powershell</a> documentation asap but  I&#8217;m in need of bit of a quick fix at the moment ;-)</p>
<p>Thanks a lot for your help!</p>
<p>Jeffrey</p>
]]></content:encoded>
	</item>
</channel>
</rss>
