Automation

 View Only
  • 1.  disable firewall with get-esxcli

    Posted Nov 16, 2016 02:16 AM

    i need to disable firewall

    i see the synatax is

    $esxcli.network.firewall.set(boolean defaultaction, boolean enabled)

    Import-Csv C:\temp\esxi.csv |foreach {
    $esxcli = Get-EsxCli -VMHost $_.name

    $esxcli.network.firewall.set( PASS, $true )

    }

    i tried above is wrong

    current

    esxcli network firewall get

       Default Action: DROP

       Enabled: false

       Loaded: true

    thanks



  • 2.  RE: disable firewall with get-esxcli
    Best Answer

    Posted Nov 16, 2016 02:20 AM

    i tried below & worked

      Import-Csv C:\temp\esxi.csv |foreach {

      $esxcli = Get-EsxCli -VMHost $_.name

    $esxcli.network.firewall.set($true,$true)

    }