<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/clearspace/rss" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>VMware Communities : Document List - vSphere PowerCLI</title>
    <link>http://communities.vmware.com/community/developer/codecentral/vsphere_powercli?view=documents</link>
    <description>Latest Documents in vSphere PowerCLI</description>
    <language>en</language>
    <pubDate>Tue, 06 Oct 2009 21:13:12 GMT</pubDate>
    <generator>Clearspace 1.10.12 (http://jivesoftware.com/products/clearspace/)</generator>
    <dc:date>2009-10-06T21:13:12Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>NTP, PowerShell, It's about time.</title>
      <link>http://communities.vmware.com/docs/DOC-10871</link>
      <description>&lt;br /&gt;
There's no doubt that time is critically important in a computing&lt;br /&gt;
environment. Given this sensitivity, and the recent recognition that we&lt;br /&gt;
had rogue hosts improperly configured, I decided to crank out a script&lt;br /&gt;
that would analyze our environment. I wanted to find whether the NTPD&lt;br /&gt;
service was running, what the NTP server configuration was, and provide&lt;br /&gt;
a report of this. Additionally I wanted to have the option (with&lt;br /&gt;
commenting) to automatically make corrections. &lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
Always open to suggestions and improvements.  I hope this helps you in your environment. &lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
###----------FULL SCRIPT----------------------#####&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
Connect-VIServer -Server server.domain.com     #Enter your vCenter Server&lt;br /&gt;
&lt;br /&gt;
$NtpServer = "10.10.10.10"   #Provide your default NTP Server. This will be used as default so entering a NTP server when prompted is not necessary&lt;br /&gt;
&lt;br /&gt;
$OldNtpServer = "10.10.10.11"         #Leave set as 127.127.1.0 as default unless you wish to change settings in your environment&lt;br /&gt;
&lt;br /&gt;
$DefaultNtpServer = "127.127.1.0"    #NTP Server Value that is set on a fresh ESX installation.&lt;br /&gt;
&lt;br /&gt;
#Location based on Date&lt;br /&gt;
$date = Get-Date -UFormat %Y%m%d&lt;br /&gt;
$ExportLocation = "C:\NTP-$date.csv"&lt;br /&gt;
&lt;br /&gt;
#Location where you would like report to be saved to.&lt;br /&gt;
#$ExportLocation = 'C:\NTPReport.csv'&lt;br /&gt;
&lt;br /&gt;
$NTPHosts&lt;br /&gt;
= Get-VMHost | Select-Object Name,@{Name="NTPServer";Expression={$_ |&lt;br /&gt;
Get-VMHostNtpServer}}, @{Name="NTPRunning";Expression={($_ |&lt;br /&gt;
Get-VMHostService | Where-Object {$_.key -eq "ntpd"}).Running}} |&lt;br /&gt;
Sort-Object -Property "NTPRunning", "NTPServer"&lt;br /&gt;
&lt;br /&gt;
$NTPHosts | Export-Csv $ExportLocation -NoTypeInformation&lt;br /&gt;
&amp;#38; $ExportLocation #Opens generated report file&lt;br /&gt;
&lt;br /&gt;
$Restart = Read-Host "Would you like to start NTPD services or change NTP configurations on hosts? (y/n)"&lt;br /&gt;
#$Restart = "y"  #Comment above line and uncomment this line if you wish to automatically restart services.&lt;br /&gt;
If ($Restart -eq "y"){&lt;br /&gt;
Import-Csv $ExportLocation | % {&lt;br /&gt;
$vmhost = $_.Name&lt;br /&gt;
&lt;br /&gt;
#Checks the NTP configuration against a value previously determined at the top of script.&lt;br /&gt;
If (($_.NTPServer -eq $OldNtpServer) -or ($_.NTPServer -eq $DefaultNtpServer)){&lt;br /&gt;
$NtpInput&lt;br /&gt;
= Read-Host "Some servers are configured with NTP set as $OldNtpServer&lt;br /&gt;
or $DefaultNtpServer and may need their NTP settings reconfigured.&lt;br /&gt;
Please enter NTP Server FQDN or IP address. &amp;lt;$NtpServer&amp;gt; is&lt;br /&gt;
default."&lt;br /&gt;
&lt;br /&gt;
If ($NtpInput -ne "") {&lt;br /&gt;
$NtpServer = $NtpInput&lt;br /&gt;
#Sets $NtpServer to the inputted value and does nothign if left blank.&lt;br /&gt;
This allows use of default when value is consistent in the environment.&lt;br /&gt;
}&lt;br /&gt;
Add-VMHostNtpServer -VMHost $vmhost -NtpServer $NtpServer | Where-Object {$_.NTPServer -eq $OldNtpServer}&lt;br /&gt;
Remove-VMHostNtpServer -VMHost $vmhost -NtpServer $OldNtpServer&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#Now time to restart any NTPD services that are currently not running.&lt;br /&gt;
If ($_.NTPRunning -eq "False") {&lt;br /&gt;
Get-VmHostService -VMHost $vmhost | Where-Object {$_.key -eq "ntpd"} | Start-VMHostService&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
Write-Host "Process Complete"</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">script</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">ntp</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">maintenance</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">configuration</category>
      <pubDate>Tue, 06 Oct 2009 21:07:56 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10871</guid>
      <dc:date>2009-10-06T21:07:56Z</dc:date>
      <clearspace:dateToText>1 month, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Configure Switching for ESX host based on .CSV</title>
      <link>http://communities.vmware.com/docs/DOC-10863</link>
      <description>A couple of weeks ago I was in need to configure several new ESX servers with multiple NICs, vSwitches, and VLANs. Since I'm not one to do the same thing over and over again I turned to scripting. To further complicate things I wanted to allow the same script to create vSwitches, configure vMotion switch, add port groups, and create NIC Teams all from a prepopulated .CSV file. I'm doing this primarily so that all configuration could be done before the server arrived and so that I could create "Switch Profiles" when I add new hosts to clusters.&lt;br /&gt;
&lt;br /&gt;
In the end I developed a script that reads from a .CSV file and then creates the desired switching. The first column tells the script what type of addition it is and the script processes the information for that object accordingly. I've noticed a few others have been posting recently about scripts on setting up portgroups, etc. and thought it was time to no longer keep this to myself (i.e. finally found the time to post). I too would like to also credit Hal Rottenburg's book &lt;a class="jive-link-external" href="http://www.amazon.com/Managing-VMware-Infrastructure-Windows-PowerShell/dp/0982131402"&gt;Managing VMware Infrastructure with Windows Powershell&lt;/a&gt; which was very helpful for this and many other scripting projects I will be posting soon. Mike Laverick's &lt;a class="jive-link-external" href="http://www.rtfm-ed.co.uk/?p=1514"&gt;post&lt;/a&gt; linked below helped in configuring the vMotion switch.&lt;br /&gt;
&lt;br /&gt;
I hope you find this helpful. It has been HUGE in my environment.&lt;br /&gt;
&lt;br /&gt;
Download the files here:&lt;br /&gt;
&lt;a class="jive-link-external" href="http://jatwell.no-ip.info/Main/download/scripts/ESX-ConfigureSwitchCSV-Generic.txt"&gt;ESX-ConfigureSwitchCSV-Generic.txt&lt;/a&gt;&lt;br /&gt;
&lt;a class="jive-link-external" href="http://jatwell.no-ip.info/Main/Download/Scripts/esx_switching-generic.csv"&gt;esx_switching_generic.csv&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Links where others discuss switch configuration with PowerCLI.&lt;br /&gt;
&lt;a class="jive-link-external" href="http://halr9000.com/article/828"&gt;http://halr9000.com/article/828&lt;/a&gt;&lt;br /&gt;
&lt;a class="jive-link-external" href="http://www.holy-vm.com/2009/10/01/adding-port-groups-with-powercli/"&gt;http://www.holy-vm.com/2009/10/01/adding-port-groups-with-powercli/&lt;/a&gt;&lt;br /&gt;
&lt;a class="jive-link-external" href="http://www.rtfm-ed.co.uk/?p=1514"&gt;http://www.rtfm-ed.co.uk/?p=1514&lt;/a&gt;&lt;br /&gt;
&lt;p /&gt;
Text of Script w/out comments&lt;br /&gt;
&lt;br /&gt;
$getinfo = Import-Csv "\\server\share\file.csv"&lt;br /&gt;
Connect-VIServer -Server vCenterServer&lt;br /&gt;
&lt;br /&gt;
$getinfo | % {&lt;br /&gt;
$Type = $_.Type #!!!! Case Sensitive !!!!!!&lt;br /&gt;
$gethost = Get-VMHost -Name $_.HostName&lt;br /&gt;
$SwitchName = $_.SwitchName&lt;br /&gt;
$PortGroup = $_.PortGroupName&lt;br /&gt;
$Nic = $_.NIC&lt;br /&gt;
$VLAN = $_.VLAN&lt;br /&gt;
$IP = $_.IP&lt;br /&gt;
$Subnet = $_.Subnet&lt;br /&gt;
$kernelGW = $_.KernelGW&lt;br /&gt;
&lt;br /&gt;
If ($Type -eq "Switch") {&lt;br /&gt;
$gethost | New-VirtualSwitch -Name $SwitchName -Nic $Nic&lt;br /&gt;
}&lt;br /&gt;
If ($Type -ne "vMotion") {&lt;br /&gt;
$getswitch = Get-VirtualSwitch -VMHost $gethost -Name $SwitchName&lt;br /&gt;
}&lt;br /&gt;
If ($Type -eq "Team"){&lt;br /&gt;
$getswitch | Set-VirtualSwitch -Nic $Nic&lt;br /&gt;
}&lt;br /&gt;
IF ($Type -eq "Portgroup") {&lt;br /&gt;
$getswitch | New-VirtualPortGroup $PortGroup -VLanId $VLAN&lt;br /&gt;
}&lt;br /&gt;
IF ($Type -eq "vMotion") {&lt;br /&gt;
&lt;br /&gt;
$newvswitch = New-VirtualSwitch -VMHost $gethost -Name $SwitchName -Nic $Nic&lt;br /&gt;
$vmotion = New-VirtualPortGroup -VirtualSwitch $newvswitch -Name $PortGroup&lt;br /&gt;
New-VMHostNetworkAdapter -VMHost $gethost -PortGroup $PortGroup -VirtualSwitch $newvswitch -IP $IP -SubnetMask $subnet -VMotionEnabled: $true&lt;br /&gt;
&lt;br /&gt;
$vmhostnetwork = get-vmhostnetwork $gethost&lt;br /&gt;
set-vmhostnetwork -network $vmhostnetwork -vmkernelgateway $kernelGW&lt;br /&gt;
}&lt;br /&gt;
}</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">script</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">scripting</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">networking</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vswitch</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">portgroups</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">csv</category>
      <pubDate>Tue, 06 Oct 2009 17:32:12 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10863</guid>
      <dc:date>2009-10-06T17:32:12Z</dc:date>
      <clearspace:dateToText>1 month, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Job-Rescan-ALL-HBA</title>
      <link>http://communities.vmware.com/docs/DOC-10855</link>
      <description>This program will rescan all the HBA's in your vm enviroment, and instead of doing it one at a time, it creates a seperate job for each ESX host. Thus multithreading the rescan. For ESX 3.5 this is really handy, for vsphere 4 you can have it do a rescan of all HBA's through the vi interface. But this will work against vsphere as well. &lt;br /&gt;
&lt;br /&gt;
I developed this script as I needed a quick way to rescan the HBA's when a failover of our HP EVA occurs. And I need the servers to rescan. I'll be working on another version which will suspend the vm's on a particular LUN, failover that particular LUN, rescan and then restart the vm.. As you can imagine this will be tricky and others have written it for other storage systems but not for HP EVA's.  &lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;#Rescan all HBA's creating 1 job for each ESX server


# Kyle Weir, jkw117@gmail.com, 10-05-09

#connects initially to get the list of ESX servers 



Connect-VIServer  &amp;quot;vcenter&amp;quot; -User Administrator -Password password 



vm=get-vmhost



#Passes the server names individually to different jobs. Thus allowing it to ask each ESX host to rescan itself. 



for ($x=0 ; $x -le $vm.length; $x++)
{
Start-Job -ArgumentList $vm[$x|http://communities.vmware.com/community-document-picker.jspa?communityID=3077&amp;#38;subject=%24x].name -ScriptBlock {
Add-PSSnapin VMware.VimAutomation.Core
Connect-VIServer  &amp;quot;vcenter&amp;quot; -User Administrator -Password $pasd
get-vmhost $args| Get-VMHostStorage -RescanAllHBA -rescanVMFS -refresh
} 
} 


&lt;/code&gt;&lt;/pre&gt; &lt;br /&gt;
&lt;p /&gt;
Any questions please email me, I am sure this can be updated to eliminate</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">hba</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">storage</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">performance</category>
      <pubDate>Mon, 05 Oct 2009 14:57:13 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10855</guid>
      <dc:date>2009-10-05T14:57:13Z</dc:date>
      <clearspace:dateToText>1 month, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Service status and email if down (as well as try to start it)</title>
      <link>http://communities.vmware.com/docs/DOC-10641</link>
      <description>Here is a script I sorta came up with that checks common vmware services and then emails if any one of them aren't running (and trys to start them)(since our vsphere upgrade bombed a few times thanks to sql i was asked to try to write this), I am sure this has been done before and bits where taking from another place that I can't find again to give credit, so its not all mine, but somone might find this usefull, write back with questions or comments&lt;br /&gt;
&lt;br /&gt;
Thanks!&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">service</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">script</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">email</category>
      <pubDate>Mon, 31 Aug 2009 19:48:03 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10641</guid>
      <dc:date>2009-08-31T19:48:03Z</dc:date>
      <clearspace:dateToText>2 months, 3 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Number of vCPUs in a cluster</title>
      <link>http://communities.vmware.com/docs/DOC-10565</link>
      <description>&lt;br /&gt;
Inspired by Jason Boche&amp;rsquo;s article: &lt;a class="jive-link-external" href="http://www.boche.net/blog/index.php/2009/08/18/hidden-virtual-cpu-limit-restriction-in-esx-3-5/"&gt;http://www.boche.net/blog/index.php/2009/08/18/hidden-virtual-cpu-limit-restriction-in-esx-3-5/&lt;/a&gt; and also William Lam&amp;rsquo;s Perl Script (&lt;a class="jive-link-wiki" href="http://communities.vmware.com/docs/DOC-10556"&gt;http://communities.vmware.com/docs/DOC-10556&lt;/a&gt;).  I decided to re-create this in PowerCLI.&lt;br /&gt;
&lt;p /&gt;
More information can be found here: &lt;a class="jive-link-external" href="http://www.virtu-al.net/2009/08/20/powercli-number-of-vcpus-in-a-cluster/"&gt;http://www.virtu-al.net/2009/08/20/powercli-number-of-vcpus-in-a-cluster/&lt;/a&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">cluster</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vmservers</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vm</category>
      <pubDate>Thu, 20 Aug 2009 21:13:42 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10565</guid>
      <dc:date>2009-08-20T21:13:42Z</dc:date>
      <clearspace:dateToText>3 months, 5 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>vCheck (Daily Report) V3</title>
      <link>http://communities.vmware.com/docs/DOC-10521</link>
      <description>&lt;br /&gt;
Daily Report does what it says on the tin, it runs as a scheduled task before you get into the office to present you with key information about your infrastructure in a nice easily readable format.&lt;br /&gt;
&lt;br /&gt;
For more information see &lt;a class="jive-link-external" href="http://www.virtu-al.net/2009/07/14/powercli-daily-report/#more-792"&gt;my blog post&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
This script picks on the key areas of the virtual infrastructure and reports it all in one place so all you do in the morning is check your email.&lt;br /&gt;
&lt;br /&gt;
One of they key things about this report is if there is no issue in a particular place you will not receive that section in the email, for example if there are no datastores with less than 5% free space (configurable) then the disk space section will not show in the email, this ensures that you have only the information you need in front of you when you get into the office.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
Initially when I started this script I wanted people to be clear&lt;br /&gt;
that this was a report that was going to give you a daily summary of&lt;br /&gt;
any issues which may exist in your Virtual Infrastructure, from the&lt;br /&gt;
beta testing I did to a select few it was clear that they were&lt;br /&gt;
expecting this to send them a full inventory of their infrastructure.&lt;br /&gt;
&lt;p /&gt;
That wasn&amp;rsquo;t the point in this script and I think people now have the&lt;br /&gt;
idea that this is more of an issue log than an audit script so I will&lt;br /&gt;
now revert to my original name of&amp;hellip;. &lt;b&gt;vCheck.&lt;/b&gt;&lt;br /&gt;
&lt;p /&gt;
The key thing to remember is that if an issue does not exist in a&lt;br /&gt;
particular area then it will not show in the output, when and if issues&lt;br /&gt;
turn up they will start appearing in the output almost like magic !&lt;br /&gt;
&lt;p /&gt;
I want to thank everyone who is using this script and those who have&lt;br /&gt;
left a comment, even if its just to say how much you like it !&lt;br /&gt;
&lt;p /&gt;
I especially want to thank Rapha&amp;euml;l SCHITZ (&lt;a class="jive-link-external" href="http://www.hypervisor.fr/"&gt;http://www.hypervisor.fr/&lt;/a&gt;) for all his contributions, he has added some great features to this version and helped me take it to a new level.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;b&gt;So what areas does this script report on ?&lt;/b&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
The previous version already reported on these areas:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;General Details
&lt;ul&gt;
&lt;li&gt;Number of Hosts&lt;/li&gt;
&lt;li&gt;Number of VMs&lt;/li&gt;
&lt;li&gt;Number of Templates&lt;/li&gt;
&lt;li&gt;Number of Clusters&lt;/li&gt;
&lt;li&gt;Number of Datastores&lt;/li&gt;
&lt;li&gt;Number of Active VMs&lt;/li&gt;
&lt;li&gt;Number of Inactive VMs&lt;/li&gt;
&lt;li&gt;Number of DRS Migrations for the last days&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Snapshots over x Days old&lt;/li&gt;
&lt;li&gt;Datastores with less than x% free space&lt;/li&gt;
&lt;li&gt;VMs created over the last x days&lt;/li&gt;
&lt;li&gt;VMs removed over the last x days&lt;/li&gt;
&lt;li&gt;VMs with No Tools&lt;/li&gt;
&lt;li&gt;VMs with CD-Roms connected&lt;/li&gt;
&lt;li&gt;VMs with Floppy Drives Connected&lt;/li&gt;
&lt;li&gt;VMs stored on local datastores&lt;/li&gt;
&lt;li&gt;VMs with CPU ready over x%&lt;/li&gt;
&lt;li&gt;VMs with over x amount of vCPUs&lt;/li&gt;
&lt;li&gt;List of DRS Migrations&lt;/li&gt;
&lt;li&gt;Hosts in Maintenance Mode&lt;/li&gt;
&lt;li&gt;Hosts in disconnected state&lt;/li&gt;
&lt;li&gt;NTP Server check for a given NTP Name&lt;/li&gt;
&lt;li&gt;NTP Service check&lt;/li&gt;
&lt;li&gt;vmkernel warning messages ov the last x days&lt;/li&gt;
&lt;li&gt;VC Error Events over the last x days&lt;/li&gt;
&lt;li&gt;VC Windows Event Log Errors for the last x days with VMware in the details&lt;/li&gt;
&lt;li&gt;VC VMware Service details&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;So what is added to V3 ?&lt;/b&gt;&lt;br /&gt;
&lt;p /&gt;
Well firstly I have fixed some bugs which existed in V2 and made things slightly faster.&lt;br /&gt;
&lt;p /&gt;
The other added features are as below:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Status report to screen whilst running interactively&lt;/li&gt;
&lt;li&gt;At the top of the script you can now turn off any areas you do not want to report on (this makes it faster to run)&lt;/li&gt;
&lt;li&gt;VMs on Local storage has been changed to report VMs stored on datastores attached to only one host&lt;/li&gt;
&lt;li&gt;VM active alerts&lt;/li&gt;
&lt;li&gt;Cluster Active Alerts&lt;/li&gt;
&lt;li&gt;If HA Cluster is set to use host datastore for swapfile, check the host has a swapfile location set&lt;/li&gt;
&lt;li&gt;Host active Alerts&lt;/li&gt;
&lt;li&gt;Dead SCSI Luns&lt;/li&gt;
&lt;li&gt;VMs with over x amount of vCPUs&lt;/li&gt;
&lt;li&gt;vSphere check: Slot Sizes&lt;/li&gt;
&lt;li&gt;vSphere check: Outdated VM Hardware (Less than V7)&lt;/li&gt;
&lt;li&gt;VMs in Inconsistent folders (the name of the folder is not the same as the name)&lt;/li&gt;
&lt;li&gt;Added the number of issues to each title line&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
As always please let me know if you have any comments, I already&lt;br /&gt;
have some great ideas that I could not fit into this version so watch&lt;br /&gt;
out for V4 !&lt;br /&gt;
&lt;p /&gt;
+Also a reminder that this script also checks your Windows&lt;br /&gt;
vCenter server for services and event logs, it does this via WMI and&lt;br /&gt;
therefore needs the correct permissions, there is still an area at the&lt;br /&gt;
top of the script which you can give alternate credentials from the&lt;br /&gt;
account that is running the script if needed.+&lt;br /&gt;
&lt;p /&gt;
If your new to this script and would like more details on how it looks or how to run it please check &lt;a class="jive-link-external" href="http://www.virtu-al.net/2009/07/14/powercli-daily-report/"&gt;this post.&lt;/a&gt;&lt;br /&gt;
&lt;p /&gt;
At the bottom of he script is also an area which you can uncomment to save a the daily report as a htm file in a specific folder.&lt;br /&gt;
&lt;br /&gt;
I think that&amp;rsquo;s it !&lt;br /&gt;
&lt;br /&gt;
If there is anything missing please let me know and I will add it to future versions.&lt;br /&gt;
&lt;br /&gt;
To run this script simple setup a scheduled task as per my previous post running the script and passing it your VI server as a parameter as below:&lt;br /&gt;
&lt;br /&gt;
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile &amp;ldquo;C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vim.psc1&amp;Prime; &amp;rdquo; &amp;#38;  &amp;ldquo;C:\Scripts\DailyReport.ps1 TESTVC01&amp;Prime;</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">email</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">report</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">snapshots</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">storage</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">tools</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vmdks</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vm</category>
      <pubDate>Wed, 12 Aug 2009 22:38:55 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10521</guid>
      <dc:date>2009-08-12T22:38:55Z</dc:date>
      <clearspace:dateToText>2 weeks, 5 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>Folder Name Mismatch</title>
      <link>http://communities.vmware.com/docs/DOC-10233</link>
      <description>&lt;br /&gt;
Isn&amp;rsquo;t it annoying when you are looking for a VM on your datastore and you cant find it because the folder name is not the same as the VM,&lt;br /&gt;
use the below script and you will never have that problem again.&lt;br /&gt;
&lt;br /&gt;
This script will compare the name of the VM to the folder it is stored in, any mismatches will be output.&lt;br /&gt;
&lt;br /&gt;
I know a regex expert could probably do this better, let me know if you are one  &lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
&lt;table class="jive-wiki-table"&gt;
&lt;tr&gt;
&lt;td&gt;VM&lt;/td&gt;
&lt;td&gt;Path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New VM 1&lt;/td&gt;
&lt;td&gt;storage1 New VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ABCDEV01&lt;/td&gt;
&lt;td&gt;storage1 Dev Test&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MicroDS&lt;/td&gt;
&lt;td&gt;SAN11 New VM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VM127&lt;/td&gt;
&lt;td&gt;SAN11 Windows 2003 Server&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br clear="left" /&gt;
&lt;br /&gt;
For more information visit: &lt;a class="jive-link-external" href="http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/"&gt;http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/&lt;/a&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vm</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vmdks</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <pubDate>Wed, 24 Jun 2009 13:17:40 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10233</guid>
      <dc:date>2009-06-24T13:17:40Z</dc:date>
      <clearspace:dateToText>5 months, 2 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>Snapshot Email Reminder</title>
      <link>http://communities.vmware.com/docs/DOC-10232</link>
      <description>&lt;br /&gt;
Fed up of chasing those people who constantly create snapshots and leave them hanging around for weeks or even months on end ?&lt;br /&gt;
&lt;br /&gt;
You no longer have to do the chasing, just use the following script to automatically find the offending snapshot, find the person who created it, get their email address from AD and send them an email reminding them of their mortal sin.&lt;br /&gt;
&lt;br /&gt;
A few requirements:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The accounts must have the E-Mail field filled outin AD&lt;/li&gt;
&lt;li&gt;The account you run the script as must have read permissions to AD (Any member of the domain should have this)&lt;/li&gt;
&lt;li&gt;You need to fill in the smtp server address, VI Server name and the from address at the top of this script&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
The script is set to remind of anything over 2 weeks old but this can easily be amended&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
More information is available here: &lt;a class="jive-link-external" href="http://www.virtu-al.net/2009/06/22/powercli-snapreminder/"&gt;http://www.virtu-al.net/2009/06/22/powercli-snapreminder/&lt;/a&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">snapshot</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">email</category>
      <pubDate>Wed, 24 Jun 2009 13:01:19 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10232</guid>
      <dc:date>2009-06-24T13:01:19Z</dc:date>
      <clearspace:dateToText>5 months, 2 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>Clone VM from SnapShot</title>
      <link>http://communities.vmware.com/docs/DOC-10034</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3077">vm_operations</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">clone</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">cloning</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vm</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">snapshot</category>
      <pubDate>Wed, 20 May 2009 21:04:24 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10034</guid>
      <dc:date>2009-05-20T21:04:24Z</dc:date>
      <clearspace:dateToText>2 months, 2 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>3</clearspace:replyCount>
    </item>
    <item>
      <title>Health Check VM</title>
      <link>http://communities.vmware.com/docs/DOC-10017</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3077">performance</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">general</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">health</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">check</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vm</category>
      <pubDate>Wed, 20 May 2009 18:23:21 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10017</guid>
      <dc:date>2009-05-20T18:23:21Z</dc:date>
      <clearspace:dateToText>2 months, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Get PID of VMservers</title>
      <link>http://communities.vmware.com/docs/DOC-10016</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3077">troubleshooting</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">general</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">get</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">pid</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vmservers</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">server</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vm</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">servers</category>
      <pubDate>Wed, 20 May 2009 18:21:09 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10016</guid>
      <dc:date>2009-05-20T18:21:09Z</dc:date>
      <clearspace:dateToText>2 months, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Creating Reports</title>
      <link>http://communities.vmware.com/docs/DOC-10015</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3077">general</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">creating</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">reports</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">create</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">report</category>
      <pubDate>Wed, 20 May 2009 18:19:46 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-10015</guid>
      <dc:date>2009-05-20T18:19:46Z</dc:date>
      <clearspace:dateToText>2 months, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>VI-Cluster-Audit</title>
      <link>http://communities.vmware.com/docs/DOC-7482</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">audit</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">cluster</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">ha</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">failures</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">settings</category>
      <pubDate>Sun, 31 Aug 2008 07:11:10 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7482</guid>
      <dc:date>2008-08-31T07:11:10Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>VM Service Report v1.0</title>
      <link>http://communities.vmware.com/docs/DOC-7481</link>
      <description>&lt;b&gt;This Script is to determine what services are running on what vm's in a VI organization&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
This is very handy when you have many vm's running all types of services - and can point out a rogue service you may not want to have in your VM's &lt;br /&gt;
&lt;p /&gt;
This script will require: &lt;br /&gt;
&lt;p /&gt;
An administrator account to remote servers that are in the VI as WMI is used to obtain information. &lt;br /&gt;
&lt;p /&gt;
Powershell and MS Excel. &lt;br /&gt;
&lt;p /&gt;
I get a list of services from each vm and output these along with the VM (IP information and vmnetwork for NICS.) &lt;br /&gt;
&lt;p /&gt;
There is a list of services that are excluded by default, this can be disabled if needbe, thus allowing you to get a better view of what services are installed and running on the vm's. &lt;br /&gt;
&lt;p /&gt;
I use WMI to obtain information from the servers - for this to work correctly you need to have administrator access to all of the servers and for the script to be run under this account and the servers need to have WMI/RPC running. &lt;br /&gt;
&lt;p /&gt;
So some webservers etc. may not show any services as the app can't talk to them (in some ways if it can it may be a security problem) &lt;br /&gt;
&lt;p /&gt;
In my environment I run this script under an account that is the Enterprise Admin in the root domain for the Active Directory. Or any account that has administrator access on all of the servers. &lt;br /&gt;
&lt;p /&gt;
The description is obtained as well as the status of each service to further assist the user to determine what a service is. &lt;br /&gt;
&lt;p /&gt;
Future versions will: &lt;br /&gt;
&lt;p /&gt;
&lt;ul&gt;
&lt;li&gt;Create seperate excel sheets for each ESX server - The vm's will then be displayed on those sheets as well as one consolidated sheet.&lt;/li&gt;
&lt;li&gt;ESX services will be displayed on each sheet.&lt;/li&gt;
&lt;li&gt;A port Scan will be completed on the ESX server as well as each vm - thus giving a full idea of what ports are open on the vm's&lt;/li&gt;
&lt;/ul&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vmservice</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">report</category>
      <pubDate>Sun, 31 Aug 2008 03:52:25 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7481</guid>
      <dc:date>2008-08-31T03:52:25Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>VMware Infrastructure Power Documenter</title>
      <link>http://communities.vmware.com/docs/DOC-7473</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">openxml</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powertools</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">charting</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">reporting</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">spreadsheetml</category>
      <pubDate>Sun, 31 Aug 2008 02:47:12 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7473</guid>
      <dc:date>2008-08-31T02:47:12Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
    </item>
    <item>
      <title>Guest Provisioning System (cloning from templates)</title>
      <link>http://communities.vmware.com/docs/DOC-7472</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">guest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">template</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">clone</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <pubDate>Sun, 31 Aug 2008 00:30:06 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7472</guid>
      <dc:date>2008-08-31T00:30:06Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>11</clearspace:replyCount>
    </item>
    <item>
      <title>PowerAlarm Manager</title>
      <link>http://communities.vmware.com/docs/DOC-7480</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">poweralarm</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">manager</category>
      <pubDate>Sat, 30 Aug 2008 18:24:28 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7480</guid>
      <dc:date>2008-08-30T18:24:28Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>Virtual Machine Failover between DataCenters</title>
      <link>http://communities.vmware.com/docs/DOC-7470</link>
      <description>#This is a script to failover multiple groups of virtual machines. &lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;This is for a Virtual Infrastructure based in two datacenters. Each datacenter has a SAN with a series of LUNs that are mirrored (SRDF)to the other location.&lt;/li&gt;
&lt;li&gt;There is one VirtualCenter that is a VM that this script can be run against. There is a seperate procedure to failover the VirtualCenter VM.&lt;/li&gt;
&lt;li&gt;This carries out the following actions on each virtual machine in the folders specified:&lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
&lt;li&gt;Attempt to shutdown the OS&lt;/li&gt;
&lt;li&gt;Perform a Power Off of the VM&lt;/li&gt;
&lt;li&gt;Pause to allow other procedures to be run to failover the storage and VLANs&lt;/li&gt;
&lt;li&gt;Get the Hosts to Rescan for VMFS partitions&lt;/li&gt;
&lt;li&gt;Remove the VM from the Inventory&lt;/li&gt;
&lt;li&gt;Add the VM to the Inventory but against an ESX host in the target datacenter.&lt;/li&gt;
&lt;li&gt;Perform a Power On of the VM&lt;/li&gt;
&lt;/ol&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
Usage: &amp;#38; .\VMFailover.ps1 Mode Datacenter Folder1 etc.. &lt;br /&gt;
&lt;p /&gt;
Where: &lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Mode is either DEMO or LIVE - (LIVE is the only mode that will execute commands).")&lt;/li&gt;
&lt;li&gt;Datacenter is target for the virtual machines to failover to (either "&lt;i&gt;$dc1&lt;/i&gt;" or "&lt;i&gt;$dc2&lt;/i&gt;").&lt;/li&gt;
&lt;li&gt;Folder1 (Folder2, etc) are the VirtualCenter folders containing the VMs being moved.&lt;/li&gt;
&lt;/ul&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
This script assumes you have already connected to VirtualCenter with Get-VIServer &lt;br /&gt;
&lt;p /&gt;
It also assumes that the user has full administrator rights to the Datacenter.</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">virtual</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">machine</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">failover</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">datacenters</category>
      <pubDate>Sat, 30 Aug 2008 16:06:40 GMT</pubDate>
      <author>graemengordon@hotmail.com</author>
      <guid>http://communities.vmware.com/docs/DOC-7470</guid>
      <dc:date>2008-08-30T16:06:40Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>Virtual Environment Overview Report</title>
      <link>http://communities.vmware.com/docs/DOC-7422</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">report</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">script</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vmware</category>
      <pubDate>Fri, 29 Aug 2008 17:33:39 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7422</guid>
      <dc:date>2008-08-29T17:33:39Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>17</clearspace:replyCount>
    </item>
    <item>
      <title>clonevdi</title>
      <link>http://communities.vmware.com/docs/DOC-7421</link>
      <description>This script and config file is used in our environment to clone a base image on a netapp 3020 cluster with NFS and a-sis. Cloning is done parallel on all systems mentiond in the configuration file. Afterwards sis is running on the netapp to gain storage. Different types of vm's can be specified in the configuration file and in our situation vm's disk mode is set to non-persistant. Steps are listed in the script. Good to know is that a script within the vm will force a shutdown so the process will contiue. &lt;br /&gt;
&lt;p /&gt;
Sjaak</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">netapp</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">3020</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">nfs</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">clone</category>
      <pubDate>Fri, 29 Aug 2008 09:36:51 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7421</guid>
      <dc:date>2008-08-29T09:36:51Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>VMware Healthcheck script</title>
      <link>http://communities.vmware.com/docs/DOC-7430</link>
      <description>&lt;h2&gt;VMware Healtcheck script&lt;/h2&gt;
&lt;h3&gt;Introduction: &lt;/h3&gt;
Healthcheck is a Powershell script that reports information like &lt;b&gt;snapshots&lt;/b&gt;, &lt;b&gt;VMware tools version&lt;/b&gt;, &lt;b&gt;datastore space, CDROM and/or floppy drives connected, VM details&lt;/b&gt; etc. to HTML and e-mail the output. This script can be scheduled so that for example you get every week a rapport in your mailbox with the status of the VMware environment.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Reason for creating this script: &lt;/h3&gt;
As VMware Consultant I see a lot of common problems in VMware environments like: &lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Snapshots are enabled and forgot the commit to the VM.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Datastores are almost full (for example if snapshots are enabled)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;VMware tools versions are different&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;CDROM and floppy drives are still mounted to the VM&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Virtual Machines have CPU and Memory limits or reservations (VMs are swapping)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;In the VM, the VMware Tools timesync option is not enabled&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
In the Virtual Infrastructure Client (VIC) it is difficult to see this sort of information. By creating a Powershell script, I can do a quick inventory. In a lot of VMware environments I created a scheduled tasks, so the script runs once a week and sent to HTML rapport to the administrator. &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;What does the script: &lt;/h3&gt;
I wrote a Powershell script with HELP from the VMTN community that makes a HTML file and sent the output by e-mail to a person or distribution list. The Healthcheck script does the following checks: &lt;br /&gt;
&lt;p /&gt;
&lt;ul&gt;
&lt;li&gt;VMware ESX hardware&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;VMware ESX versions&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;VMware VirtualCenter versions&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Active snapshots&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;CDROM and Floppy drive(s) mounted to the VM&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Datastore information like capacity, free space and the percentage free space&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;VirtualMachine (VM) information like VMware tools version, CPU, Memory reservations and limits etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;On what VMs VMware Tools timesync is not enabled&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h3&gt;Requirements: &lt;/h3&gt;
The following software must be installed: &lt;br /&gt;
&lt;br /&gt;
Microsoft Powershell 1.0 (&lt;a class="jive-link-external" href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx"&gt;http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx&lt;/a&gt;) &lt;br /&gt;
&lt;br /&gt;
VMware Infrastucture (VI) toolkit for Windows 1.0 &lt;br /&gt;
&lt;br /&gt;
&lt;a class="jive-link-external" href="http://www.vmware.com/download/sdk/"&gt;http://www.vmware.com/download/sdk/&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
Set the ExecutionPolicy in Windows Powershell to RemoteSigned by using the following command: &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;set-ExecutionPolicy RemoteSigned&lt;/b&gt; &lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;h3&gt;Installation: &lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Unzip the Healthcheck.zip script to a directory on the VC server for example.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;When the ZIP if unpacked there are two files:&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Healthcheck.ps1, this is the Powershell script&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Style.CSS, controls the HTML layout&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h3&gt;Configuration: &lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Edit the Powershell.ps1 file&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
edit the following variables: &lt;br /&gt;
&lt;br /&gt;
$vcserver="localhost"&lt;br /&gt;
&lt;br /&gt;
Enter the VC server, if you execute the script on the VC server you can use the localhost name&lt;br /&gt;
&lt;br /&gt;
$filelocation="D:\temp\Healthcheck.htm"&lt;br /&gt;
Specify the location where to store the HTML output&lt;br /&gt;
&lt;br /&gt;
$enablemail="yes"&lt;br /&gt;
Enable (yes) or disable (no) to sent the script by e-mail&lt;br /&gt;
&lt;br /&gt;
$smtpServer = "mail.ivobeerens.nl" &lt;br /&gt;
Specify the SMTP server in your network&lt;br /&gt;
&lt;br /&gt;
$mailfrom = "VMware Healtcheck &amp;lt;mailto:powershell@ivobeerens.nl&amp;gt;"&lt;br /&gt;
Specify the from field&lt;br /&gt;
&lt;br /&gt;
$mailto = mailto:ivo@ivobeerens.nl&lt;br /&gt;
&lt;br /&gt;
Specify the address where the e-mail to sent to&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;h3&gt;Usage: &lt;/h3&gt;
Manually run the Healthcheck.ps1 script": &lt;br /&gt;
&lt;br /&gt;
1. Open Powershell &lt;br /&gt;
&lt;br /&gt;
2. Browse to the directory where the Healthcheck.ps1 script resides &lt;br /&gt;
&lt;br /&gt;
3. enter the command: &lt;br /&gt;
&lt;br /&gt;
./Healthcheck.ps1 &lt;br /&gt;
&lt;br /&gt;
To create a schedule task in for example Windows 2003 use the following syntax in the run property:&lt;br /&gt;
Powershell -command "&amp;#38; 'path\Healthcheck.ps1'&lt;br /&gt;
edit the path &lt;br /&gt;
&lt;br /&gt;
Powershell -command "&amp;#38; 'path\Healthcheck.ps1' &lt;br /&gt;
&lt;br /&gt;
edit the path . &lt;br /&gt;
&lt;p /&gt;
&lt;h3&gt;Future: &lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;List Orphaned VMDK's&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Add performance information like VM usage&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Check timesync on the VMware hosts&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Happy testing &lt;img src="http://communities.vmware.com/images/emoticons/happy.gif" alt="http://communities.vmware.com/images/emoticons/happy.gif" class="jive-image"  /&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vmware</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">snapshot</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">storage</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vmware</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">tools</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">version</category>
      <pubDate>Thu, 28 Aug 2008 20:05:41 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7430</guid>
      <dc:date>2008-08-28T20:05:41Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>5</clearspace:replyCount>
    </item>
    <item>
      <title>Rescan HBAs on all hosts in a cluster</title>
      <link>http://communities.vmware.com/docs/DOC-7400</link>
      <description>Need to add or expand a LUN to all the hosts of a cluster? This simple script can save you a lot of time if you are using the GUI to do a rescan on a largish cluster. This script can easily be adapted to rescan on specific clusters or hosts.&lt;br /&gt;
&lt;br /&gt;
Change line 1 to point to the correct Virtual Center server.  &lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
Enjoy&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
-Chris Summers</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">rescan</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">hba</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">hosts</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">cluster</category>
      <pubDate>Thu, 28 Aug 2008 00:54:31 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7400</guid>
      <dc:date>2008-08-28T00:54:31Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
    </item>
    <item>
      <title>Get-VDMData (takes a username and returns data about all the Virtual Desktops they are entitled to use)</title>
      <link>http://communities.vmware.com/docs/DOC-7392</link>
      <description>We get tickets from users that are having an issue with their Virtual Desktops and we only have their username to figure out which VM they are using. It can be a pain to find out which VMs they are entitled to in the GUI so I wrote a script to pull the data.&lt;br /&gt;
&lt;br /&gt;
I have found that there are currently no VMWare cmdlets that allow you to get data from Virtual Desktop Manager directly. However, VDM stores it's data in an ADAM instance and PowerShell can connect to ADAM to get at the data.&lt;br /&gt;
&lt;br /&gt;
My script will prompt you for your credentials (to talk to Virtual Center and Virtual Desktop Manager) and then prompt you for a username. It will then convert the username to a SID and lookup the SID in the ADAM instance on your VDM server to find which VMs the user is entitled to use. The script then uses the VIToolkit cmdlets to pull information about those VMs.&lt;br /&gt;
&lt;br /&gt;
You need to update the script with data for these variables:&lt;br /&gt;
&lt;p /&gt;
$VCServer - this needs to be the FQDN of your Virtual Center server&lt;br /&gt;
&lt;p /&gt;
$VDMServer - this is the Virtual Desktop Manger server that has the entitlement information for the user&lt;br /&gt;
&lt;p /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
This document was generated from the following thread: &lt;a class="jive-link-thread" href="http://communities.vmware.com/thread/165534"&gt;Get-VDMData (takes a username and returns data about all the Virtual Desktops they are entitled to use)&lt;/a&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powerhsell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">get-vmddata</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">virtual</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">desktop</category>
      <pubDate>Wed, 27 Aug 2008 18:32:41 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7392</guid>
      <dc:date>2008-08-27T18:32:41Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>Create Disaster Recovery Hard Drive</title>
      <link>http://communities.vmware.com/docs/DOC-7380</link>
      <description>&lt;h6&gt;Update 27-Aug-08: Script updated for VI Toolkit 1.0 and Powershell v2 CTP2&lt;/h6&gt;
&lt;h1&gt;Create Disaster Recovery Hard Drive&lt;/h1&gt;
&lt;h2&gt;Motivation &lt;/h2&gt;
This script was created out of a motivation of laziness. Since VM's proliferate so fast, most backup and disaster recovery solutions are a pain in the ass because you have to manually add and remove virtual machines to their backup processes. What if there was a way to automatically add and remove VM's to a backup solution simply because of where they are located in Virtualcenter? What if I had an automated DR solution to removable USB hard drives for my smaller clients that was FREE? &lt;br /&gt;
&lt;br /&gt;
Hence this script. This script dynamically backs up all VM's in a particular Virtualcenter folder using VCB, and drops them out to a USB hard drive for disaster recovery purposes. If I don't want a VM backed up anymore, I simply take it out of that folder. &lt;br /&gt;
&lt;br /&gt;
Note that this also leverages the new networked method of VCB, so &lt;b&gt;YOU DO NOT NEED A SAN AND DIRECT ACCESS TO THE LUNs.&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
The script is also flexible enough so that if you do have the SAN VCB configuration, you can do LAN-free backups with this method too. &lt;br /&gt;
&lt;br /&gt;
Note that the query here is just an example. Any way you can return a list of VM's, you can give it to the backup-vm cmdlet. &lt;br /&gt;
&lt;br /&gt;
Some examples that come to mind: &lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Backup all virtual machines with disks under 500MB in size&lt;/li&gt;
&lt;li&gt;Backup all virtual machines created after July 1st&lt;/li&gt;
&lt;li&gt;Backup all virtual machines with "Prod" in their names&lt;/li&gt;
&lt;li&gt;Backup all virtual machines with a custom attribute defined called "BackMeUp" set to true&lt;/li&gt;
&lt;li&gt;Backup all virtual machines currently residing on a particular host, cluster, or datacenter.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
This script took me about 8 hours, mostly because I was learning how to do script cmdlets and dealing with all the incompatabilities/breakage of CTP Powershell releases as well. &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Script Cmdlets&lt;/h2&gt;
The task evolved into my first foray into the new Script Cmdlets in Powershell v2. They're so easy to make I went wild and wrote a near-complete wrapper to VCB. Cut and paste the "cmdlet" section out of the code and put it in your profile, and you can now use the Backup-VM cmdlet. &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Usage&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Install onto a server or workstation with the prerequisites defined in the script (VCB, Powershell v2 CTP2, VI Toolkit v1.0)&lt;/li&gt;
&lt;li&gt;Edit the parameters of the script to suit your environment. &lt;b&gt;BE VERY CAREFUL WITH VMBackupDestination&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Run to test, then set up as a scheduled task on a daily interval.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
Example Screenshot:&lt;br /&gt;
&lt;a class="jive-link-external" href="http://i36.tinypic.com/5zeel1.png"&gt;VCB Backup Script in Action&lt;/a&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">recovery</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">disaster</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">hard</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">drive</category>
      <pubDate>Wed, 27 Aug 2008 18:19:25 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7380</guid>
      <dc:date>2008-08-27T18:19:25Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
    </item>
    <item>
      <title>Get-VIReports</title>
      <link>http://communities.vmware.com/docs/DOC-7372</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3077">report</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">compare</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">config</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vmware</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">tools</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">datastore</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">snapshots</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <pubDate>Wed, 27 Aug 2008 04:53:12 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7372</guid>
      <dc:date>2008-08-27T04:53:12Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>ESXi Builder 1.4 and other utility scripts (Configure ESXi from Factory Settings)</title>
      <link>http://communities.vmware.com/docs/DOC-7364</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3077">esxi</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">configure</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">esxibuilder</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vi_toolkit</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">scripting</category>
      <pubDate>Wed, 27 Aug 2008 02:48:11 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7364</guid>
      <dc:date>2008-08-27T02:48:11Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>Business Continuity Roll over Script</title>
      <link>http://communities.vmware.com/docs/DOC-7238</link>
      <description>&lt;b&gt;Background:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Current Environment&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Primary Datacenter located in New Orleans, La. running VMWare 2.5.4 with an EMC CX3-80 backend.&lt;/li&gt;
&lt;li&gt;Backup Datacenter located in Dallas, Tx. running VMWare 2.5.4 with an EMC CX3-80 backend&lt;/li&gt;
&lt;li&gt;45mb point to point connection running between sites.&lt;/li&gt;
&lt;li&gt;All VMWare LUNs setup to replicate using Mirrorview/a with a policy of Time finished +60 minutes schedule.&lt;/li&gt;
&lt;li&gt;60 luns with 8tb of data in use and mirrored between the sites.&lt;/li&gt;
&lt;li&gt;Based on our Corporate, Disaster Recovery policy, we begin the process of moving our environment from New Orleans to Dallas once Level X is reached. Level X is defined as a hurricane with winds of X, and landfall expected within X hours.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Once Level X is reached, we begin the process of moving our servers to our secondary site, using the following high-level steps.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Run vb script which will update all ip addresses of the current vm's to a network range that is already configured at the secondary site.&lt;/li&gt;
&lt;li&gt;Manually shutdown all vm's in a specific order, with our virtual SQL server being last.&lt;/li&gt;
&lt;li&gt;On each ESX server, run our "copy config" script which copies all currently registered VM information to each ESX server's partner server at the other location.&lt;/li&gt;
&lt;li&gt;Manually remove the luns from the New Orleans EMC VMWare Storage Group&lt;/li&gt;
&lt;li&gt;Manually sync each luns remote mirror group&lt;/li&gt;
&lt;li&gt;Manually set each mirror to manual sync policy to ensure that the primary location stays "pristine" until we have successfully restarted at secondary site and tested by for replicating the changes in the reverse direction.&lt;/li&gt;
&lt;li&gt;Once each mirror is synced, promote the secondary image.&lt;/li&gt;
&lt;li&gt;Manually add each lun to the Dallas EMC VMWare Storage Group&lt;/li&gt;
&lt;li&gt;On each ESX Server, run the "register vm" script to register the vms based on the information that was copied in one of the previous steps.&lt;/li&gt;
&lt;li&gt;Reboot each ESX server, so that the VMs can auto-restart, rebooting the one with SQL first.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
With this configuration, there are two major issues.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Since we are changing the IP addresses of the VMs and up dating DNS, some of our remote sites may not see the updated addresses for anywhere from 4 to 6 hours.&lt;/li&gt;
&lt;li&gt;LUNs were not layed out to allow for Tier roll over. All luns have to finish replicating before we can start any servers up. We can still get our servers restarted in less than 4 hours, but all servers are down until all data is replicated.&lt;/li&gt;
&lt;li&gt;SAN work requires a lot of manual steps.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;About 2 weeks ago we started the build out of our new VMWare 3.5 environment. We had the following high level goals.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;No ip address changes&lt;/li&gt;
&lt;li&gt;Roll of servers based on a priority design&lt;/li&gt;
&lt;li&gt;Remove as many manual steps as possible.&lt;/li&gt;
&lt;li&gt;Ability to run Production systems at both sites with the ability to move either site if necessary.&lt;/li&gt;
&lt;li&gt;Single script regardless of site or direction of move&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;Configuration of New Environment&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;VMWare 3.5&lt;/li&gt;
&lt;li&gt;EMC CX3-80&lt;/li&gt;
&lt;li&gt;Tiered configuration, which each Tier being assigned it's own LUNs&lt;/li&gt;
&lt;li&gt;A New Orleans production set of servers and a Dallas set of servers, with each having it's own set of tiers, luns and subnet&lt;/li&gt;
&lt;li&gt;Single Script that can move set in a priority fashion to either side, with minimal user steps.
&lt;ul&gt;
&lt;li&gt;Still requires manually moving subnet, but takes about 5-10 minutes to complete the required steps. (NO VM ip address changes needed)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;Attached files&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Business Continuity Script Assumptions.doc&lt;/b&gt; - This file contains all assumptions of our design and some script requirements.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;SAN_Information.csv&lt;/b&gt; - This file is an input to the script and documents the EMC configuration for each VMWare Datastore. This information must be accurate for the script to work. &lt;i&gt;The script includes a menu option 99, which allows the testing of the "move" of a lun before it is used in production. This will allow us to validate the information in the csv file&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Business Continuity.ps1&lt;/b&gt; - The actual Script file. It includes a number of functions that perform the following goals.
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Run_Navi_Cmds&lt;/b&gt; - Input is primary SAN location and Datastore that script is actively working with. Will perform the following actions.
&lt;ul&gt;
&lt;li&gt;Move the lun associated with this datastore out of the primary san's storage group&lt;/li&gt;
&lt;li&gt;Sync the mirror associated with this lun with the secondary image at the secondary site&lt;/li&gt;
&lt;li&gt;Once synced, will promote the secondary image to primary&lt;/li&gt;
&lt;li&gt;Once promoted, will add the new primary to the ESX storage group at the secondary site&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Determine_Tier -&lt;/b&gt; used by other functions to determine which tier is being actively worked on.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Determine_Move_Direction&lt;/b&gt; - Let the user define which Data Center is primary and which group of servers is being moved. It will also create the files holding the each tiers VM and datastore information&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Display_Tier_Datastores&lt;/b&gt; - Verifies that any Datastores in use by a given tier is not being used by VMs in another tier&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Delete_VMs&lt;/b&gt; - will allow user to pick tier being worked on, using the vm tier file, will try and shutdown any powered on VM, once powered off, will remove VM from inventory. Once all VMs are removed, will use the tier's datastore file to run the Run_Navi_Cmds function for each datastore in use.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Register_VMs&lt;/b&gt; - will allow user to pick tier being worked on, using the vm tier file, will try register all VMs on the appropriate ESX server at the other site&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;This is an active on going project and our new VMWare 3.5 environment has not been moved to production.&lt;/b&gt; We have successfully tested all aspects of our new design without issues. However, we are not finished our testing and will likely be adding additional features to this procedure. &lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;i&gt;For example, we will probably add to the Run_Navi_cmds function a routine to set all mirrors to manual (no auto syncing). As a policy, we do not replicate from the new primary site to the original primary site until after we have successfully restarted all machines. This gives us a rollback option if we have startup issues. We will also add a menu option to allow us to put a tiers mirror back in auto once we have successfully restarted the VMs at the new primary site.&lt;/i&gt;&lt;/blockquote&gt;
Based on our preliminary testing, we should see a big improvement in our failover process. For our Tier 1 servers, we expect them to be down no more than 30 minutes once we start our roll process. This alone will allow our upper management to have access to email, blackberry's and other critical data 3 hours faster than our current system setup. During a hurricane event, 3 hrs can be significant &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color:#ff0000"&gt;Use at your own risk. This script was tailored for a very specific setup and having a script manipulate your SAN can cause serious issues. &lt;/span&gt;&lt;/b&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">business</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">continuity</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">scripting</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">storage</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">san</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <pubDate>Fri, 22 Aug 2008 13:58:05 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7238</guid>
      <dc:date>2008-08-22T13:58:05Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>function destroy-network</title>
      <link>http://communities.vmware.com/docs/DOC-7093</link>
      <description>This is untested for obvious reasons. For the same reasons, i've uploaded it as a txt file instead of as a ps1.  &lt;br /&gt;
&lt;p /&gt;
This powershell function should sequentially remove from your VIServer all:  snapshots, templates, VMs, resource pools, folders, clusters, datacenters virtual port groups, virtual switches, network adapters, host network adapters, storage adapters, stop all vm host services, remove all hosts, and host accounts.&lt;br /&gt;
&lt;p /&gt;
It's usefulness is limited to those having a test VIServer that needs to be stripped and started from scratch. I don't recommend you execute this function, it's too dangerous, but the evil had to be released...&lt;br /&gt;
&lt;p /&gt;
 USE AT YOUR OWN RISK!</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vi_toolkit</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">destroy-network</category>
      <pubDate>Fri, 15 Aug 2008 21:15:34 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7093</guid>
      <dc:date>2008-08-15T21:15:34Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
    </item>
    <item>
      <title>Shutdown VM in specific Resource Pools</title>
      <link>http://communities.vmware.com/docs/DOC-7080</link>
      <description>We have a very small VMware server population right now as we are just getting started. Consequentially keeping the non-production systems offline after hours to ensure HA resource availability is crucial for us. This script shuts off all VMs NOT in our "production" and "Infrastructure" resource pools.&lt;br /&gt;
&lt;p /&gt;
$serv = Connect-VIServer -Server VC01&lt;br /&gt;
$pools = Get-ResourcePool -Server $serv | where-object { ($_.Name -ne "Production") -and ($_.Name -ne "Resources") -and ($_.Name -ne "Infrastructure") }&lt;br /&gt;
foreach ($pool in $pools ) {&lt;br /&gt;
 $vms = Get-VM -Location $pool | where-object {$_.PowerState -eq "PoweredOn"}&lt;br /&gt;
 foreach ($vm in $vms) {&lt;br /&gt;
  if ( $vm -ne $null ) {&lt;br /&gt;
   Shutdown-VMGuest -VM $vm &lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
}</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">resource_pool</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">shutdown_vm</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <pubDate>Thu, 14 Aug 2008 19:59:42 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7080</guid>
      <dc:date>2008-08-14T19:59:42Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
    </item>
    <item>
      <title>Report into MS Word</title>
      <link>http://communities.vmware.com/docs/DOC-7070</link>
      <description>Firstly, I wanted you to know that I only started with PowerShell around a month ago when I saw the cool things you were doing with the beta of the VI toolkit, so not only have I been learning the toolkit but also PowerShell, this will hopefully excuse the basics of my code and I am sure that the experts will find a better (and faster) way of doing it !  &lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;Scenario:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
You have convinced your IT Manager that VI3 is the best virtualisation product compared to the others out there on the market (that was the easy bit). You have told him how much money you will save him and how environmentally friendly his server room will now be.  He has dusted off his corporate wallet and agreed to pay for.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
Your "pointy haired" IT Manager has asked for a weekly report of what is virtualised and an overall status of what is happening in this new wonderful system, whilst you are working 24hr shifts just to get the downtime for servers whilst your users sleep you do not have time to keep creating reports.....Enter my script !&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;b&gt;Answer:&lt;/b&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
You could send him a bunch of html emails and csv outputs but your manager would only need help importing them and help understanding what each file is.  This script not only outputs all the results straight to MS Word but also adds nice colourful graphs and pie charts (which we all know makes managers happy).  The script can be easily added too, to enable further output utilising the functions.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
It can also email the results directly to the manager and maybe be used in a scheduled task ?!&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
&lt;b&gt;On a personal Note:&lt;/b&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
This has really given me a reason to start to learn PowerShell (I have been meaning to for ages) and also learn how to use the fantastic new VI toolkit, if nothing else I have gained the valuable experiences of learning PS and the toolkit.  Thanks to the creators.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
&lt;b&gt;Usage:&lt;/b&gt;&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
Report.ps1 YOURVISERVER&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
You will need MS Word and the Office Web Components (script will tell you where to download if not installed)&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
This script takes a varied amount of time to run and only reads data, no configuration changes are made at all, obviously the bigger system the longer it will take, not that you would notice if it was a scheduled task.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
The email areas are currently commented out at the end awaiting customisation if needed.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
Sorry if it doesnt work on your VI, I have not been able to test as extensively as I would have liked due to only having one VI.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
Office XP/2003/2007 tested.</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">scripting</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">toolkit</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <pubDate>Thu, 14 Aug 2008 14:18:43 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-7070</guid>
      <dc:date>2008-08-14T14:18:43Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>30</clearspace:replyCount>
    </item>
    <item>
      <title>Get-StorageInfo</title>
      <link>http://communities.vmware.com/docs/DOC-6991</link>
      <description>Many VMware environments will consist of multiple ESX servers, with multiple HBAs, connecting to multiple SCSI Targets, having access to multiple LUNs, which are used as extents for numerous datastores. In order to be able to use Vmotion, all LUNs should be accessible on all ESX hosts in a cluster. And in order to ensure reliability and availability, each component in the chain will have to be redundant. This amounts to multiple paths to each LUN, from each ESX host. While your environment grows, the number of paths grows exponentially. My script allows you to analyse complex environments and check for missing links, misconfigurations such as a LUN not masked to one of your ESX hosts or a multipath policy that is set to a wrong value.&lt;br /&gt;
&lt;br /&gt;
My &lt;b&gt;Get-StorageInfo&lt;/b&gt; script processes all LUNs connected to ESX Servers within a specified VMware Cluster. It builds a custom collection of objects representing these LUNs, with the following properties: &lt;i&gt;VMHost, LUNPath, Policy, Prefer, Datastore, Vendor, Model, VMHBA, SCSITarget, LUNID, LUNKey&lt;/i&gt;. The script should be dot-sourced to allow the user to view, filter and sort this collection. The script will check if it is being dot-sourced. The script also prvides the user with two functions for common sorting and filtering tasks, as well as two examples for using them.&lt;br /&gt;
&lt;br /&gt;
Type &lt;b&gt;Show-DatastorePaths&lt;/b&gt; for an overview of LUNs and path counts.&lt;br /&gt;
Type &lt;b&gt;Show-LUNs&lt;/b&gt; for a detailed overview of Luns, which can be filtered by using the following parameters: VMHost, LUNID, Policy, Datastore, Vendor, Model.&lt;br /&gt;
&lt;u&gt;Examples:&lt;/u&gt;&lt;br /&gt;
&lt;i&gt;Show-LUNs -Datastore PRD -Policy mru&lt;/i&gt; #Finds LUNs where the datastore name contains PRD and the policy is set to MRU&lt;br /&gt;
&lt;i&gt;$LUNCollection | Where{$_.Datastore -eq $null} | Group-Object LUNID&lt;/i&gt; #Shows LUN IDs that have no datastore name (e.g. RDMs or unused LUNs)&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;A bit more info on the inner workings of the script:&lt;/u&gt;&lt;br /&gt;
In order to get all LUNs via all different paths I go through a set of nested loops. First looping through all VMHosts in the cluster, then looping through VMHBAs, then SCSI Targets and finally LUNs.&lt;br /&gt;
Not all properties I wanted to use are available within these loops. Therefore, for each VMHost a collection is built containing the relationship between Datastore names and Extents (in the form of a LUN path e.g. vmhba1:0:123). This allows the script to link the datastore name to those LUN paths that are actively used. The multipath policy and preferred path and the Vendor and Model of the LUN storage device are also found by using the LUN path.&lt;br /&gt;
After looping through all of the above, only a fraction of the LUN references have all the properties filled in: the actively used ones. Next, the script loops through the entire collection of LUN references in the collection, matching references to the same LUN by comparing the LUNKey or UUID and copying the properties that were empty.&lt;br /&gt;
That's a lot of looping, I hear you think. That's right. And it will take some time to complete. In our environment it takes about ten minutes generating the entire collection of 1440 references to different LUNs. But the result is a very rich array of items which - using the awesome power of Powershell - can generate a lot of usefull information for your environment.&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;UPDATE:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I have modified the script to include the following:&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Easy to use input prompt and menu eliminate the need to edit the script before use.&lt;/li&gt;
&lt;li&gt;Improved progress indicators now show percentage completed for each step.&lt;/li&gt;
&lt;li&gt;Advanced logic determines the discrepancies in storage configuration between hosts. These potential configuration errors are displayed on screen with all relevant properties of the involved LUNs / Datastores!&lt;/li&gt;
&lt;/ul&gt;
&lt;p /&gt;
Test the script by adding a LUN to only one ESX server in a cluster. This misconfiguration (which will cause VMotion of a VM with files on that LUN to fail!) should be spotted by the script.&lt;br /&gt;
&lt;p /&gt;
&lt;b&gt;&lt;u&gt;UPDATE 2:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;p /&gt;
Added support for Folders. Added menu choices that allow you to run the script against all VMHosts in a Folder or in a Cluster or even ALL VMHosts in your VC Server.</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vi_toolkit</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">scripting</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">storage</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">lun</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">information</category>
      <pubDate>Tue, 12 Aug 2008 09:06:21 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-6991</guid>
      <dc:date>2008-08-12T09:06:21Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>Find snapshots and send email to user/users</title>
      <link>http://communities.vmware.com/docs/DOC-6980</link>
      <description>&lt;br /&gt;
We have had some issues where VCB doesn't clean up after itself everytime it runs so I wrote a quick script that will query all the VM's for current snapshots left over and send an email to me with the name of the VM, Snapshot Name,  Description,Date of Creation and Host it is running on.&lt;br /&gt;
&lt;p /&gt;
 Follow the comments in the script and change the variables where needed to suit your environment.</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">find</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">snapshots</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">email</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">users</category>
      <pubDate>Tue, 12 Aug 2008 04:09:14 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-6980</guid>
      <dc:date>2008-08-12T04:09:14Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
    </item>
    <item>
      <title>Dynamic Resource Pool Calculator</title>
      <link>http://communities.vmware.com/docs/DOC-6970</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">dynamic</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">resource</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">pool</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">calculator</category>
      <pubDate>Mon, 11 Aug 2008 18:59:09 GMT</pubDate>
      <author>esloof@ntpro.nl</author>
      <guid>http://communities.vmware.com/docs/DOC-6970</guid>
      <dc:date>2008-08-11T18:59:09Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>Find Orphaned VMDK's</title>
      <link>http://communities.vmware.com/docs/DOC-6960</link>
      <description>&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
(This script is for ESX 3.01, to find snapshots on 3.5 and above change the script en the names it searches for!!!!!) &lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
This script will find all orphaned vmdk's on all your virtual centers (we have more than one :p).&lt;br /&gt;
&lt;br /&gt;
Our VM's are being administered by mutliple people. When removing a virtual disk, sometimes people forget to delete the vmdk file itself.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
This script asks the virtual center what the disk are of each VM and puts this into an array. After this, it reads all files on all datastores. If the file is a vmdk file, it will check wheter this file is in the array. If it's not, you've found a orphaned vmd.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
Output is being written to a file.  Script displays the Host off which files are being enumerated(For waiting purposes).&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
Variables whcih have to be submitted:&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
$arrayVC = "YourVirtualCenter"&lt;br /&gt;
$OutputFile = "C:\OrphanedVMDK.txt"&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
Greetings,&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
Ad van Bokhoven &lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
This document was generated from the following thread: &lt;a class="jive-link-thread" href="http://communities.vmware.com/thread/162178"&gt;Find Orphaned VMDK's&lt;/a&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">find</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">orphaned</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vmdks</category>
      <pubDate>Mon, 11 Aug 2008 12:55:53 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-6960</guid>
      <dc:date>2008-08-11T12:55:53Z</dc:date>
      <clearspace:dateToText>5 months, 1 week ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
    </item>
    <item>
      <title>powerVDI</title>
      <link>http://communities.vmware.com/docs/DOC-6930</link>
      <description />
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">contest</category>
      <category domain="http://communities.vmware.com/tags?communityID=3077">vdi</category>
      <pubDate>Fri, 08 Aug 2008 21:36:24 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-6930</guid>
      <dc:date>2008-08-08T21:36:24Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>Getting PID of running Virtual Machines from a list of servers</title>
      <link>http://communities.vmware.com/docs/DOC-1360</link>
      <description>&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;#Powershell and plink from Putty
#Getting PID of running Virtual Machines from a list of servers
#You shall supply a password for root as a parameter to the script
param($password = $(throw 'You shall supply a password for root'))
#List of servers
$servers = &amp;quot;esx01&amp;quot;,&amp;quot;esx02&amp;quot;,&amp;quot;esx03&amp;quot;,&amp;quot;esx04&amp;quot;
$data = @()
$account=&amp;quot;root&amp;quot;
$regexp ='^root +(?&amp;lt;pid&amp;gt;[1234567890]+).*[/]+(?&amp;lt;machine&amp;gt;.*)[.]vmx$'

for ($i=0;$i -lt $servers.Length; $i++) {
$data += new-Object psobject
$data[$i] | add-Member -membertype noteproperty -name server -value $servers[$i]
$t1=$account + &amp;quot;@&amp;quot; + $servers[$i] + &amp;quot;.avisen.dk&amp;quot;
$t2=.\plink -pw $password $t1 &amp;quot;ps auxfw | grep vmkload_app | grep vmx$&amp;quot;
foreach ($f in $t2) {
$f -match $regexp &amp;gt; $null
$data[$i] | add-Member -membertype noteproperty -name $matches.machine -value $matches.pid
}
}
$data
&lt;/code&gt;&lt;/pre&gt;</description>
      <category domain="http://communities.vmware.com/tags?communityID=3077">powershell</category>
      <pubDate>Sun, 30 Sep 2007 17:59:43 GMT</pubDate>
      <guid>http://communities.vmware.com/docs/DOC-1360</guid>
      <dc:date>2007-09-30T17:59:43Z</dc:date>
      <clearspace:dateToText>6 months, 5 days ago</clearspace:dateToText>
    </item>
  </channel>
</rss>

