Adding routes on multiple ESXi hosts

Today I am sharing script to configure routes on multiple hosts. Below is the script




Connect-VIServer testvc
$hosts = Get-VMHost -Location TEST

foreach( $vmhost in $hosts)
{

New-VMHostRoute -VMHost $vmhost -Destination 192.168.10.0 -Gateway 192.168.0.1 -PrefixLength 24
}

Disconnect-VIServer testvc

No comments:

Post a Comment