PowerCLI Reference

Set-VMHostFirewallDefaultPolicy

Synopsis

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

Syntax

Set-VMHostFirewallDefaultPolicy [[-AllowIncoming] <Boolean>] [[-AllowOutgoing] <Boolean>] [-Policy] <VMHostFirewallDefaultPolicy[]> [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-VMHostFirewallDefaultPolicy

Detailed 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

NameTypeDescriptionRequired?Pipeline InputDefault Value
AllowIncomingBooleanIf the value of this parameter is $true, all incoming connections are allowed. If the value is $false, all incoming connections are disallowed.falsefalse
AllowOutgoingBooleanIf the value of this parameter is $true, all outcoming connections are allowed. If the value is $false, all outcoming connections are disallowed.falsefalse
PolicyVMHostFirewallDefaultPolicy[]Specifies the host firewall default policy you want to apply.truetrue (ByValue)
ConfirmSwitchParameterIf 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.falsefalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

Zero or more VMHostFirewallDefaultPolicy objects

Notes

Firewall management functionality is not supported on ESX 3i.

Examples

-------------- 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


Copyright © VMware, Inc. All rights reserved.