PowerShell/VMware/set_vmotion_vmk.ps1
2025-02-19 17:52:50 +00:00

10 lines
892 B
PowerShell
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#$vmhosts = Get-VMHost -location kfh0pxccl06
$vs = Get-VirtualSwitch -Name "kfh0pxccl05_BackEnd"
$entries = Get-Content e:\vmotion_disweb.csv
cls
foreach ($entry in $entries){
$vmhost = $entry.Split(";")[1]
$ip = $entry.Split(";")[0]
Write-Host HOST $vmhost IP $ip
New-VMHostNetworkAdapter -VMHost (Get-VMHost $vmhost) -PortGroup "kfhDISWEBVMOTION-853" -VirtualSwitch $vs -IP $ip -SubnetMask 255.255.255.0 -VMotionEnabled:$true
}