## PowerCLI Reference

# Get-SecurityPolicy

## Synopsis

This cmdlet retrieves the security policy for virtual port groups or the default port security policy for virtual switches.

Syntax

Get-SecurityPolicy [-VirtualSwitch] <VirtualSwitch[]> [-Server <VIServer[]>] [<CommonParameters>]
Get-SecurityPolicy [-VirtualPortGroup] <VirtualPortGroup[]> [-Server <VIServer[]>] [<CommonParameters>]

Related Commands

Online version
Set-SecurityPolicy

Detailed Description

This cmdlet retrieves the security policy for virtual port groups or the default port security policy for virtual switches.

Parameters

Name | Type | Description | Required? | Pipeline Input | Default Value
--- | --- | --- | --- | --- | ---
VirtualPortGroup | VirtualPortGroup[] | Specifies a virtual port group for which you want to retrieve the security policy. | true | true (ByValue)
VirtualSwitch | VirtualSwitch[] | Specifies a virtual switch for which you want to retrieve the default port security policy. | true | true (ByValue)
Server | VIServer[] | Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. | false | false

Return Type

One or more VirtualSwitchSecurityPolicy or VirtualPortgroupSecurityPolicy objects

Notes

Examples

-------------- 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".

Copyright © VMware, Inc. All rights reserved.