VMware Cloud Community
esxi1979
Expert
Expert
Jump to solution

disable firewall with get-esxcli

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

0 Kudos
1 Solution

Accepted Solutions
esxi1979
Expert
Expert
Jump to solution

i tried below & worked

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

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

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

}

View solution in original post

0 Kudos
1 Reply
esxi1979
Expert
Expert
Jump to solution

i tried below & worked

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

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

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

}

0 Kudos