Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #script to migrate VMs off of VMWare host
- #connects to VCenter
- connect-viserver VISERVERNAME
- #sets source server
- $source = Read-Host 'What server are we moving VMs from?'
- #Set's target server
- $target = Read-Host 'What Server are we moving VMs to?'
- #Writes VMs to CSV for later migration back to host
- get-vmhost $source | get-vm | select Name | Export-Csv H:\Migrated-VMs.CSV -NoTypeInformation
- #Moves VMs
- get-vmhost $source | get-vm | move-vm -destination $target -vmotionpriority high
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement