< Back

Get-NsxSecurityPolicyRule

Sat Jan 18, 2020 9:11 pm

NAME Get-NsxSecurityPolicyRule



SYNOPSIS

Retrieves rules defined on the specified Security Policy.





SYNTAX

Get-NsxSecurityPolicyRule -SecurityPolicy <XmlElement> [-RuleType <String>] [[-Name] <String>] [-ObjectId

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





DESCRIPTION

A security policy is a policy construct that can define one or more rules in

several different categories, that can then be applied to an arbitrary

number of Security Groups in order to enforce the defined policy.



The three categories of rules that can be included in a Security Policy are:



- Guest Introspection - data security, anti-virus, and vulnerability

management and rules based on third party Guest Introspection capability.

- Firewall rules - creates appropriate distributed firewall rules when

the policy is applied to a security group.

- Network introspection services - Thirdparty firewall, IPS/IDS etc.



Get-NsxSecurityPolicyRule retrieves firewall, guest introspection and

network introspection rules defined on the specified policy.





PARAMETERS

-SecurityPolicy <XmlElement>

Security Policy to retrieve rules from.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-RuleType <String>

Type of rule to retrieve. Defaults to all.



Required? false

Position? named

Default value All

Accept pipeline input? false

Accept wildcard characters? false



-Name <String>

Name of rule to retrieve.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ObjectId <String>

Name of rule to retrieve.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Connection <PSObject>

PowerNSX Connection object



Required? false

Position? named

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-NsxSecurityPolicy SecPol01 | Get-NsxSecurityPolicyRule



Retrieves all defined rules from the security policy SecPol01









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



PS C:\\>Get-NsxSecurityPolicy SecPol01 | Get-NsxSecurityPolicyRule -RuleType Firewall



Retrieves all defined firewall rules from the security policy SecPol01









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



PS C:\\>Get-NsxSecurityPolicy SecPol01 | Get-NsxSecurityPolicyRule -RuleType Network



Retrieves all defined network introspection rules from the security policy SecPol01









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



PS C:\\>Get-NsxSecurityPolicy SecPol01 | Get-NsxSecurityPolicyRule -RuleType Guest



Retrieves all defined guest introspection rules from the security policy SecPol01









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



PS C:\\>Get-NsxSecurityPolicy SecPol01 | Get-NsxSecurityPolicyRule -Name TestRule



Retrieves the rule called TestRule from the security policy SecPol01









-------------------------- EXAMPLE 6 --------------------------



PS C:\\>Get-NsxSecurityPolicy SecPol01 | Get-NsxSecurityPolicyRule -ObjectId firewallpolicyaction-10



Retrieves the specified from the security policy SecPol01











RELATED LINKS