< Back

Set-NsxFirewallRule

Sat Jan 18, 2020 9:27 pm

NAME Set-NsxFirewallRule



SYNOPSIS

Set configuration for a NSX Distributed Firewall Rule.





SYNTAX

Set-NsxFirewallRule [-FirewallRule] <XmlElement> [[-disabled] <Boolean>] [[-logged] <Boolean>] [[-name] <String>]

[[-action] <String>] [[-comment] <String>] [[-Connection] <PSObject>] [<CommonParameters>]





DESCRIPTION

An NSX Distributed Firewall Rule defines a typical 5 tuple rule and is

enforced on each hypervisor at the point where the VMs NIC connects to the

portgroup or logical switch.



This cmdlet accepts a firewall rule object returned from Get-NsxFirewallRule

and set configuration (disabled, name, action...)





PARAMETERS

-FirewallRule <XmlElement>

DFW rule as returned by Get-NsxFirewallRule / New-NsxFirewallRule



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-disabled <Boolean>



Required? false

Position? 2

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-logged <Boolean>



Required? false

Position? 3

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-name <String>



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-action <String>



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-comment <String>



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Connection <PSObject>

PowerNSX Connection object.



Required? false

Position? 7

Default value $defaultNSXConnection

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



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-NsxFirewallRule -Ruleid 1007 | Set-NsxFirewallRule -disabled:$true



Disabled the RuleId 1007









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-NsxFirewallRule -Ruleid 1007 | Set-NsxFirewallRule -logged:$true



Enable logging on the RuleId 1007









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Get-NsxFirewallRule -Ruleid 1007 | Set-NsxFirewallRule -name "My Distributed Firewall Rule"



Set/Update the description of the RuleId 1007









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>Get-NsxFirewallRule -Ruleid 1007 | Set-NsxFirewallRule -action deny



Change action to deny to RuleId 1007









-------------------------- EXAMPLE 5 --------------------------



PS C:\\>Get-NsxFirewallRule -Ruleid 1007 | Set-NsxFirewallRule -comment "My Comment"



Set/update the comment of the RuleId 1007











RELATED LINKS