< Back

Get-SecurityPolicy

Sun Jan 19, 2020 6:52 pm

NAME 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 [-VirtualPortGroup] <VirtualPortGroup[]> [-Server <VIServer[]>] [<CommonParameters>]



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





DESCRIPTION

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

switches.





PARAMETERS

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VirtualPortGroup <VirtualPortGroup[]>

Specifies a virtual port group for which you want to retrieve the security policy.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-VirtualSwitch <VirtualSwitch[]>

Specifies a virtual switch for which you want to retrieve the default port security policy.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

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

One or more VirtualSwitchSecurityPolicy or VirtualPortgroupSecurityPolicy objects







NOTES









-------------------------- 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 LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... olicy.html

Set-SecurityPolicy