< Back

Set-NsxSecurityPolicy

Sat Jan 18, 2020 9:29 pm

NAME Set-NsxSecurityPolicy



SYNOPSIS

Updates the specified NSX Security Policy.





SYNTAX

Set-NsxSecurityPolicy -Policy <Object> [-NoConfirm] [-Connection <PSObject>] [<CommonParameters>]



Set-NsxSecurityPolicy -Policy <Object> [-NoConfirm] [-Name <String>] [-Description <String>] [-InheritPolicy

<Object>] [-DisableInheritance] [-Weight <String>] [-Connection <PSObject>] [<CommonParameters>]





DESCRIPTION

An NSX Security Policy is a set of Endpoint, firewall, and network

introspection services that can be applied to a security group.



This cmdlet re-configures the specified security policy.





PARAMETERS

-Policy <Object>

Security Policy object to update



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-NoConfirm [<SwitchParameter>]

Disable confirmation prompt



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Name <String>

Configure the policies name



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Description <String>

Configure the policies description



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-InheritPolicy <Object>

Configure inheritance for the specified policy



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DisableInheritance [<SwitchParameter>]

Disable inheritance for the specified policy



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Weight <String>

Configure the policies weight (precedence)



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 TestSP | Set-NsxSecurityPolicy -weight 10000



Reconfigure the weight of an existing policy.









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



PS C:\\>Get-NsxSecurityPolicy TestSP | Set-NsxSecurityPolicy -name NewPol



Reconfigure the name of an existing policy.









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



PS C:\\>$sp = Get-NsxSecurityPolicy UberPol



Get-NsxSecurityPolicy TestSP | Set-NsxSecurityPolicy -InheritPolicy $sp



Configure TestSP to inherit the policy UberPol.









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



PS C:\\>Get-NsxSecurityPolicy TestSP | Set-NsxSecurityPolicy -DisableInheritance



Disable policy inheritance on TestSP.









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



PS C:\\>$sp = Get-NsxSecurityPolicy TestSP



PS C:\\> $sp.description = "New description"

PS C:\\> Set-NsxSecurityPolicy -Policy $sp



Retrieve and existing policy, update an XML element manually and put the

updated XML back. Any valid XML changes can be pushed this way.











RELATED LINKS