Connect-VIServer -Server 10.10.10.200 -User admin -Password 'testpass' $VMs=get-vm foreach ($vm in $VMs) { $VMHost_Name = $vm.vmhost.name if ($VMHost_Name -eq "10.10.10.11") { Write-Host "Change datastore of" $VM.Name Move-VM -vm $VM.Name -datastore local_240 } }
Facebook Comments Box