< Back

New-NsxSecurityGroup

Sat Jan 18, 2020 9:18 pm

NAME New-NsxSecurityGroup



SYNOPSIS

Creates a new NSX Security Group.





SYNTAX

New-NsxSecurityGroup [-Name] <String> [[-Description] <String>] [[-IncludeMember] <Object[]>] [[-ExcludeMember]

<Object[]>] [[-scopeId] <String>] [-Universal] [-ReturnObjectIdOnly] [-ActiveStandbyDeployment] [[-Connection]

<PSObject>] [<CommonParameters>]





DESCRIPTION

An NSX Security Group is a grouping construct that provides a powerful

grouping function that can be used in DFW Firewall Rules and the NSX

Service Composer.



This cmdlet creates a new NSX Security Group.



A Security Group can consist of Static Includes and Excludes as well as

dynamic matching properties. At this time, this cmdlet supports only static

include/exclude members.



A valid PowerCLI session is required to pass certain types of objects

supported by the IncludeMember and ExcludeMember parameters.





PARAMETERS

-Name <String>

Name of the Security Group



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Description <String>

Optional description for the new Security Group



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-IncludeMember <Object[]>

Static include membership



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ExcludeMember <Object[]>

Static exclude membership



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-scopeId <String>

Scope of object. For universal object creation, use the -Universal switch.



Required? false

Position? 5

Default value globalroot-0

Accept pipeline input? false

Accept wildcard characters? false



-Universal [<SwitchParameter>]

Create the IPSet as Universal object.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-ReturnObjectIdOnly [<SwitchParameter>]

Return only an object ID, not the full object.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-ActiveStandbyDeployment [<SwitchParameter>]

Flag to allow static membership of Universal Security Tags and dynamic membership via VM Name. See

https://blogs.vmware.com/networkvirtual ... ents.html/



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Connection <PSObject>

PowerNSX Connection object



Required? false

Position? 6

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:\\>Example1: Create a new SG and include App01 and App02 VMs (get-vm requires a



valid PowerCLI session)



PS C:\\> New-NsxSecurityGroup -Name TestSG -Description "Test creating an NSX

SecurityGroup" -IncludeMember (get-vm app01),(get-vm app02)



Example2: Create a new SG and include cluster1 except for App01 and App02

VMs (get-vm and get-cluster requires a valid PowerCLI session)



PS C:\\> New-NsxSecurityGroup -Name TestSG -Description "Test creating an NSX

SecurityGroup" -IncludeMember (get-cluster cluster1)

-ExcludeMember (get-vm app01),(get-vm app02)











RELATED LINKS