<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>danejeffrey.com &#187; VMware</title>
	<atom:link href="http://danejeffrey.com/blog/category/technology/vmware-technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://danejeffrey.com/blog</link>
	<description>Good ways to break things.</description>
	<lastBuildDate>Wed, 05 Oct 2011 00:13:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>VMware PowerCLI for Host and Guest CPU Details, Includes OS and Power State</title>
		<link>http://danejeffrey.com/blog/2011/01/25/vmware-powercli-for-host-and-guest-cpu-details-includes-os-and-power-state/</link>
		<comments>http://danejeffrey.com/blog/2011/01/25/vmware-powercli-for-host-and-guest-cpu-details-includes-os-and-power-state/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 05:44:31 +0000</pubDate>
		<dc:creator>danejeff</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://danejeffrey.com/blog/?p=504</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://danejeffrey.com/blog/2011/01/25/vmware-powercli-for-host-and-guest-cpu-details-includes-os-and-power-state/' addthis:title='VMware PowerCLI for Host and Guest CPU Details, Includes OS and Power State '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>The following will get CPU (num of cores) counts from hosts and will also get vCPU counts from VM&#8217;s. It will also get the operating system of each VM, its power state and the average CPU for the past week. The end of each section also has a count of the number of objects (hosts [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://danejeffrey.com/blog/2011/01/25/vmware-powercli-for-host-and-guest-cpu-details-includes-os-and-power-state/' addthis:title='VMware PowerCLI for Host and Guest CPU Details, Includes OS and Power State ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://danejeffrey.com/blog/2011/01/25/vmware-powercli-for-host-and-guest-cpu-details-includes-os-and-power-state/' addthis:title='VMware PowerCLI for Host and Guest CPU Details, Includes OS and Power State '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>The following will get CPU (num of cores) counts from hosts and will also get vCPU counts from VM&#8217;s. It will also get the operating system of each VM, its power state and the average CPU for the past week. The end of each section also has a count of the number of objects (hosts and VMs) in the environment.</p>
<pre class="brush:vb">Connect-VIServer &lt;Your_vCenter_Server&gt;
# define start and finish days (1 week period)
$startdate=(get-date).addDays(-7)
$finishdate=(get-date).addDays(-1)
# initialise counters
$vmcount=0
$hostcount=0

ForEach ($esxhost in (Get-VMHost | Sort Name)){
	Write-Host $esxhost.Name","$esxhost.NumCPU
    $hostcount++
}
Write-Host "Total Hosts:" $hostcount

ForEach ($vm in (Get-VM | Sort Name)){
    If ($vm.PowerState -eq 'PoweredOn'){
        $vstats = (Get-Stat -entity $vm -stat cpu.usage.average -Start $startdate -Finish $finishdate | measure-object -property value -average)
        # round to two decimal places
        $vavg = [system.math]::round($vstats.average,2)
    }Else{
        $vavg = 0
    }
	Write-Host $vm.Name","$vm.Guest.OSFullName","$vm.PowerState","$vm.NumCPU","$vavg
    $vmcount++
}

Write-Host "Total VM's:" $vmcount</pre>
<img src="http://danejeffrey.com/blog/?ak_action=api_record_view&id=504&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://danejeffrey.com/blog/2011/01/25/vmware-powercli-for-host-and-guest-cpu-details-includes-os-and-power-state/' addthis:title='VMware PowerCLI for Host and Guest CPU Details, Includes OS and Power State ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://danejeffrey.com/blog/2011/01/25/vmware-powercli-for-host-and-guest-cpu-details-includes-os-and-power-state/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VMware Packages &#8211; Where to Download VMware Tools for Your OS</title>
		<link>http://danejeffrey.com/blog/2011/01/06/vmware-packages-where-to-download-vmware-tools-for-your-os/</link>
		<comments>http://danejeffrey.com/blog/2011/01/06/vmware-packages-where-to-download-vmware-tools-for-your-os/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 04:21:27 +0000</pubDate>
		<dc:creator>danejeff</dc:creator>
				<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://danejeffrey.com/blog/?p=468</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://danejeffrey.com/blog/2011/01/06/vmware-packages-where-to-download-vmware-tools-for-your-os/' addthis:title='VMware Packages &#8211; Where to Download VMware Tools for Your OS '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>This is a digital mental note of where VMware Tools can be downloaded from http://www.vmware.com/download/packages.html or direct to the tree: http://packages.vmware.com/tools/index.html Also, this is my 50th post. Woohoo! A ridiculous rant might have to wait until the 100th post. Yeah, that makes sense.<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://danejeffrey.com/blog/2011/01/06/vmware-packages-where-to-download-vmware-tools-for-your-os/' addthis:title='VMware Packages &#8211; Where to Download VMware Tools for Your OS ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://danejeffrey.com/blog/2011/01/06/vmware-packages-where-to-download-vmware-tools-for-your-os/' addthis:title='VMware Packages &#8211; Where to Download VMware Tools for Your OS '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>This is a digital mental note of where VMware Tools can be downloaded from</p>
<p><a href="http://www.vmware.com/download/packages.html">http://www.vmware.com/download/packages.html</a><a href="http://packages.vmware.com/tools/index.html"></a></p>
<p>or direct to the tree:</p>
<p><a href="http://packages.vmware.com/tools/index.html">http://packages.vmware.com/tools/index.html</a></p>
<p>Also, this is my 50th post. Woohoo! A ridiculous rant might have to wait until the 100th post. Yeah, that makes sense.</p>
<img src="http://danejeffrey.com/blog/?ak_action=api_record_view&id=468&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://danejeffrey.com/blog/2011/01/06/vmware-packages-where-to-download-vmware-tools-for-your-os/' addthis:title='VMware Packages &#8211; Where to Download VMware Tools for Your OS ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://danejeffrey.com/blog/2011/01/06/vmware-packages-where-to-download-vmware-tools-for-your-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMware Converter Plug-In Fails To Install &#8211; vCenter 4.0 U1</title>
		<link>http://danejeffrey.com/blog/2010/08/27/vmware-converter-plug-in-fails-to-install-vcenter-4-0-u1/</link>
		<comments>http://danejeffrey.com/blog/2010/08/27/vmware-converter-plug-in-fails-to-install-vcenter-4-0-u1/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 07:34:57 +0000</pubDate>
		<dc:creator>danejeff</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[converter]]></category>

		<guid isPermaLink="false">http://danejeffrey.com/blog/?p=385</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://danejeffrey.com/blog/2010/08/27/vmware-converter-plug-in-fails-to-install-vcenter-4-0-u1/' addthis:title='VMware Converter Plug-In Fails To Install &#8211; vCenter 4.0 U1 '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Was getting error &#8220;Unable to Connect to Remote Server&#8221; when trying to install the Converter plug-in from vSphere Client. The plug-in name and description were also appearing as just &#8220;converter&#8221; as opposed to &#8220;vCenter Converter&#8221; as it should be. The vCenter server had been recently setup and connected to an existing database which previously had [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://danejeffrey.com/blog/2010/08/27/vmware-converter-plug-in-fails-to-install-vcenter-4-0-u1/' addthis:title='VMware Converter Plug-In Fails To Install &#8211; vCenter 4.0 U1 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://danejeffrey.com/blog/2010/08/27/vmware-converter-plug-in-fails-to-install-vcenter-4-0-u1/' addthis:title='VMware Converter Plug-In Fails To Install &#8211; vCenter 4.0 U1 '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Was getting error &#8220;Unable to Connect to Remote Server&#8221; when trying to install the Converter plug-in from vSphere Client. The plug-in name and description were also appearing as just &#8220;converter&#8221; as opposed to &#8220;vCenter Converter&#8221; as it should be. The vCenter server had been recently setup and connected to an existing database which previously had Converter installed and the plug-in available from vCenter.</p>
<p>Checked in the vCenter database for details on the plug-ins available. The table in question is [VPX_EXT_CLIENT], the field [EXT_ID] will tell you which plug-in each row refers to. In this case it is the com.vmware.converter row. Noticed that the [URL] field had spaces in it (the field read: http:/server:80/vmc/VMware Converter Client.exe). Changed the spaces to %20 (since this is a HTTP service) so the field read: http:/server:80/vmc/VMware%20Converter%20Client.exe), retried the download from vSphere Client, all worked well.</p>
<p>I figure the plug-in&#8217;s details were updated in the database when the Converter service was installed on the new vCenter service but not sure why it ended up like that. So, put the database entry back to it&#8217;s original format (i.e. spaces instead of %20&#8242;s) and went to another client that did not have the Converter plug-in installed. Interestingly, it could see the correct name and description and could download and install the plug-in&#8230;</p>
<img src="http://danejeffrey.com/blog/?ak_action=api_record_view&id=385&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://danejeffrey.com/blog/2010/08/27/vmware-converter-plug-in-fails-to-install-vcenter-4-0-u1/' addthis:title='VMware Converter Plug-In Fails To Install &#8211; vCenter 4.0 U1 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://danejeffrey.com/blog/2010/08/27/vmware-converter-plug-in-fails-to-install-vcenter-4-0-u1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VMware Site Recovery Manager with EMC RecoverPoint SRA &#8211; Server Migration (32-bit to 64-bit OS)</title>
		<link>http://danejeffrey.com/blog/2010/08/26/vmware-site-recovery-manager-with-emc-recoverpoint-sra-server-migration-32-bit-to-64-bit-os/</link>
		<comments>http://danejeffrey.com/blog/2010/08/26/vmware-site-recovery-manager-with-emc-recoverpoint-sra-server-migration-32-bit-to-64-bit-os/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 07:13:15 +0000</pubDate>
		<dc:creator>danejeff</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[emc]]></category>
		<category><![CDATA[srm]]></category>

		<guid isPermaLink="false">http://danejeffrey.com/blog/?p=374</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://danejeffrey.com/blog/2010/08/26/vmware-site-recovery-manager-with-emc-recoverpoint-sra-server-migration-32-bit-to-64-bit-os/' addthis:title='VMware Site Recovery Manager with EMC RecoverPoint SRA &#8211; Server Migration (32-bit to 64-bit OS) '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Followed this KB article on migrating an existing SRM instance to a new server. A few hiccups, however. This SRM implementation was using EMC RecoverPoint. To get the RecoverPoint SRA installed, SRM had to already be installed. However, couldn&#8217;t install SRM because it&#8217;s services would not start since the existing database it was connecting to [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://danejeffrey.com/blog/2010/08/26/vmware-site-recovery-manager-with-emc-recoverpoint-sra-server-migration-32-bit-to-64-bit-os/' addthis:title='VMware Site Recovery Manager with EMC RecoverPoint SRA &#8211; Server Migration (32-bit to 64-bit OS) ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://danejeffrey.com/blog/2010/08/26/vmware-site-recovery-manager-with-emc-recoverpoint-sra-server-migration-32-bit-to-64-bit-os/' addthis:title='VMware Site Recovery Manager with EMC RecoverPoint SRA &#8211; Server Migration (32-bit to 64-bit OS) '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Followed this <a href="http://kb.vmware.com/kb/1008426">KB article</a> on migrating an existing SRM instance to a new server. A few hiccups, however.</p>
<p>This SRM implementation was using EMC RecoverPoint. To get the RecoverPoint SRA installed, SRM had to already be installed. However, couldn&#8217;t install SRM because it&#8217;s services would not start since the existing database it was connecting to expected the SRA to be available. Resolution was along the lines of the following:</p>
<p>*Make sure you have a backup copy of the database or use a temporary database (I used backup/restore method as opposed to a temp DB)*</p>
<ol>
<li>Make sure the Site Recovery Manager Server service on the old server is stopped.</li>
<li>Backup the known good copy of the database</li>
<li>Run the SRM installer on the new 64-bit server, when prompted select the DSN (you created a 32-bit DSN, right?) to the existing database (choose to maintain the contents / do not overwrite)</li>
<li>Complete the installer</li>
<li>This is where it got funky. The Site Recovery Manager Server service fails to start so checked the logs located at %ALLUSERSPROFILE%\Application Data\VMware\VMware vCenter Site Recovery Manager\Logs (open the current .log file)</li>
<li>The prompt at the installer will have the Retry and Cancel options. If you choose Cancel it will rollback the install and leave the database in an unhealthy state &#8211; this is where our backup is going to come in handy.</li>
<li>Once the rollback completes, start the install again and complete the exact same steps (this time it will not prompt you about overwriting the existing database as it doesn&#8217;t believe the database has vaild data). Allow the install to go through &#8211; it will finish this successfully this time.</li>
<li>Now, install the EMC RecoverPoint SRA. It will install successfully since SRM is now installed.</li>
<li>Uninstall SRM (just step through the uninstaller, don&#8217;t check the box about removing the database contents &#8211; not that it will matter as we will be restoring our known good copy anyway).</li>
<li>Restore the backup of the database choosing to overwrite the database.</li>
<li>Install SRM and this time it will prompt regarding the existing database &#8211; select to use the existing database.</li>
<li>The installer will still fail this time as well, but checked the log this time and found the following:</li>
<pre class="brush:plain">[2010-08-26 15:34:40.560 03192 verbose 'PrimarySanProvider'] Loading Array Manager 'array-manager-4353' from DB object
[2010-08-26 15:34:40.560 03192 warning 'DrServiceInstance'] Initializing service content: (dr.san.fault.ManagementSystemNotFound) {
   dynamicType = ,
   faultCause = (vmodl.MethodFault) null,
   name = "C:/Program Files/VMware/VMware vCenter Site Recovery Manager/scripts/SAN/array-type-recoverpoint",
   msg = "",
}
[2010-08-26 15:34:40.560 03192 error 'App'] Application error: dr.san.fault.ManagementSystemNotFound. Shutting down ...
[2010-08-26 15:34:40.560 01788 info 'App'] [serviceWin32,421] vmware-dr service stopped</pre>
<li>The problem here is that the old server was 32-bit windows and therefore installed everything to C:\Program Files\&#8230; but our new server is 64-bit and SRM installs to C:\Program Files (x86)\&#8230;</li>
<li>The array manager script path is actually stored in the database. Find the table [pds_arraymanagere] and update the field [scriptpath] to reflect the correct (x86) directory.</li>
<li>Hit Retry and the service should start correctly.</li>
</ol>
<p>Still needed to re-pair the sites in SRM but this was the biggest hurdle in migrating the server. Also, reading that process back, the whole thing could have been done in a few different ways.Anyway, this was a bit of a worst case scenario but ultimately it worked out well.<br />
Note: This <a href="http://kb.vmware.com/kb/1006750">KB article</a> does exist, bubt it is for two specific scenarios as hihlighted in the article, not this situation</p>
<img src="http://danejeffrey.com/blog/?ak_action=api_record_view&id=374&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://danejeffrey.com/blog/2010/08/26/vmware-site-recovery-manager-with-emc-recoverpoint-sra-server-migration-32-bit-to-64-bit-os/' addthis:title='VMware Site Recovery Manager with EMC RecoverPoint SRA &#8211; Server Migration (32-bit to 64-bit OS) ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://danejeffrey.com/blog/2010/08/26/vmware-site-recovery-manager-with-emc-recoverpoint-sra-server-migration-32-bit-to-64-bit-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding Old Snapshots &#8211; VMware vSphere PowerCLI</title>
		<link>http://danejeffrey.com/blog/2010/07/06/finding-old-snapshots-vmware-vsphere-powercli/</link>
		<comments>http://danejeffrey.com/blog/2010/07/06/finding-old-snapshots-vmware-vsphere-powercli/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 01:26:30 +0000</pubDate>
		<dc:creator>danejeff</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://danejeffrey.com/blog/?p=335</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://danejeffrey.com/blog/2010/07/06/finding-old-snapshots-vmware-vsphere-powercli/' addthis:title='Finding Old Snapshots &#8211; VMware vSphere PowerCLI '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>Because it&#8217;s a pain to check all VM&#8217;s for outstanding snapshots from the VI Client, this script is useful for listing any VM&#8217;s that have outstanding snapshots and when they were created. Referenced mostly from here [vSphere PowerCLI Blog] Connect-VIServer vcenter-server.domain.com $vms = Get-VM $mybool = $False foreach ($vm in $vms){ $snap = Get-Snapshot -VM [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://danejeffrey.com/blog/2010/07/06/finding-old-snapshots-vmware-vsphere-powercli/' addthis:title='Finding Old Snapshots &#8211; VMware vSphere PowerCLI ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://danejeffrey.com/blog/2010/07/06/finding-old-snapshots-vmware-vsphere-powercli/' addthis:title='Finding Old Snapshots &#8211; VMware vSphere PowerCLI '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Because it&#8217;s a pain to check all VM&#8217;s for outstanding snapshots from the VI Client, this script is useful for listing any VM&#8217;s that have outstanding snapshots and when they were created. Referenced mostly from <a href="http://blogs.vmware.com/vipowershell/2010/02/get-your-popcorn-ready-sample-trainsignal-powercli-video.html">here</a> [vSphere PowerCLI Blog]</p>
<pre class="brush:ps">Connect-VIServer vcenter-server.domain.com
$vms = Get-VM
$mybool = $False
foreach ($vm in $vms){
$snap = Get-Snapshot -VM $vm
if ($snap){
$mybool = $True
Write-Host "VM Name: " $vm.Name " Snapshot Name: " $snap.Name " Created: " $snap.Created
}
}
exit</pre>
<p>In the above code the $mybool variable is used to keep track if any VM&#8217;s have snapshots or not. The purpose of this code was to send an email if any VM&#8217;s had snapshots. So, you could replace <code>Write-Host</code> with a string variable and write the output to that then send it via email to alert someone. You can also use the <code>$snap.Size</code> property to determine how big the VM&#8217;s snapshots have grown which is a good indicator on how long it will take to commit them back the the parent disk, if that is your aim.</p>
<img src="http://danejeffrey.com/blog/?ak_action=api_record_view&id=335&type=feed" alt="" /><div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://danejeffrey.com/blog/2010/07/06/finding-old-snapshots-vmware-vsphere-powercli/' addthis:title='Finding Old Snapshots &#8211; VMware vSphere PowerCLI ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://danejeffrey.com/blog/2010/07/06/finding-old-snapshots-vmware-vsphere-powercli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

