Automation

 View Only
  • 1.  Add ESXi Routs to Multiple host or esxi cluster using powershell

    Posted Oct 21, 2021 05:20 AM

    how to add ESXi routs using the power shell on multiple hosts or a esxi cluster Connecting to vCenter 



  • 2.  RE: Add ESXi Routs to Multiple host or esxi cluster using powershell



  • 3.  RE: Add ESXi Routs to Multiple host or esxi cluster using powershell

    Posted Oct 21, 2021 08:07 AM

    you can try as below

    Get-VMHost -PipelineVariable esx | ForEach-Object -Process {
    $esxcli = Get-EsxCli -VMHost $esx -V2
    $parms = @{
      network = '192.168.102.0/24'
      gateway = '192.168.3.1'
    }
    $esxcli.network.ip.route.ipv4.add.Invoke($parms)
    $esxcli.network.ip.route.ipv4.list.Invoke()
    }