< Back

Set-VMHostFirewallDefaultPolicy

Sun Jan 19, 2020 7:10 pm

NAME Set-VMHostFirewallDefaultPolicy



SYNOPSIS

This cmdlet sets the default policy for the specified host firewall.





SYNTAX

Set-VMHostFirewallDefaultPolicy [[-AllowIncoming] <Boolean>] [[-AllowOutgoing] <Boolean>] [-Policy]

<VMHostFirewallDefaultPolicy[]> [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

This cmdlet sets the default policy for the specified host firewall. This policy specifies whether outgoing or

incoming connections are allowed. At least one of the AllowIncoming and AllowOutgoing parameters must be set. When

you configure the default firewall policy of an ESX/ESXi host version 5.0, you must provide the same value for the

AllowIncoming and AllowOutgoing parameters.





PARAMETERS

-AllowIncoming <Boolean>

If the value of this parameter is $true, all incoming connections are allowed. If the value is $false, all

incoming connections are disallowed.



Required? false

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AllowOutgoing <Boolean>

If the value of this parameter is $true, all outcoming connections are allowed. If the value is $false, all

outcoming connections are disallowed.



Required? false

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Policy <VMHostFirewallDefaultPolicy[]>

Specifies the host firewall default policy you want to apply.



Required? true

Position? 3

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false,

the cmdlet runs without asking for user confirmation.



Required? false

Position? named

Default value $true

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Zero or more VMHostFirewallDefaultPolicy objects







NOTES





Firewall management functionality is not supported on ESX 3i.



-------------------------- Example 1 --------------------------



$firewallpolicy = Get-VMHostFirewallDefaultPolicy -VMHost 10.23.123.100



Set-VMHostFirewallDefaultPolicy -Policy $firewallpolicy -AllowOutGoing $true | fl



Changes the default firewall policy of the virtual machine host with IP address 10.23.123.100, so that the

outgoing connections are allowed.



VMHostId : HostSystem-host-8 IncomingEnabled : False OutgoingEnabled : True Client :

VMware.VimAutomation.Client20.VimClient



RELATED LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... olicy.html

Get-VMHostFirewallDefaultPolicy