Get-SecurityPolicy
This cmdlet retrieves the security policy for virtual port groups or the default port security policy for virtual switches.
Syntax
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required
|
VirtualPortGroup | VirtualPortGroup[] | named |
|
Specifies a virtual port group for which you want to retrieve the security policy. |
optional | ProgressAction | ActionPreference | named |
|
|
optional | Server | VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. |
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required
|
VirtualSwitch | VirtualSwitch[] | named |
|
Specifies a virtual switch for which you want to retrieve the default port security policy. |
optional | ProgressAction | ActionPreference | named |
|
|
optional | Server | VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. |
Output
VMware.VimAutomation.ViCore.Types.V1.Host.Networking.SecurityPolicyExamples
Example 1
Get-VirtualSwitch "MyVirtualSwitch" | Get-SecurityPolicy
Retrieves the security policy of a virtual switch named "MyVirtualSwitch".
Example 2
Get-VirtualPortGroup "MyPortgroup" | Get-SecurityPolicy
Retrieves the security policy of a virtual switch port group named "MyPortgroup".
Related Commands
SecurityInfo
This cmdlet retrieves the security information of objects (VirtualMachine, HardDisk or VMHost).
SecurityPolicy
This cmdlet retrieves the security policy for virtual port groups or the default port security policy for virtual switches.
This cmdlet modifies the security policy for virtual port groups or the default port security policy for virtual switches.