Scripts

VMware Scripts

PowerCLI get list of vMotion IP’s in use



$Array = @()
$Clusters = Get-Cluster | Sort Name
ForEach ($Cluster in $Clusters){
$VmHosts = $Cluster | Get-VmHost | Where {$_.ConnectionState -eq “Connected”} | Sort Name
ForEach ($VmHost in $VmHosts){
$Array += Get-VMHostNetworkAdapter -VMHost $VmHost.Name -VMKernel | Where {$_.VMotionEnabled -eq “True”} | select VmHost,IP
}
}
$Array | Out-GridView

 

Source: http://blog.jgriffiths.org/powercli-get-list-of-vmotion-ips-in-use/

Read More »

Date and Time in DOS

for /f “tokens=1,2,3,4,5,6 usebackq delims=.: ” %a in (‘%date% %time%’) do echo %c%b%a_%d%e%f

...Read More »