PowerCLI Reference

Set-SecurityPolicy

Synopsis

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

Syntax

Set-SecurityPolicy [-VirtualSwitchPolicy] <VirtualSwitchSecurityPolicy[]> [-AllowPromiscuous <Boolean>] [-ForgedTransmits <Boolean>] [-MacChanges <Boolean>] [-WhatIf] [-Confirm] [<CommonParameters>]

Set-SecurityPolicy [-VirtualPortGroupPolicy] <VirtualPortgroupSecurityPolicy[]> [-AllowPromiscuousInherited <Boolean>] [-ForgedTransmitsInherited <Boolean>] [-MacChangesInherited <Boolean>] [-AllowPromiscuous <Boolean>] [-ForgedTransmits <Boolean>] [-MacChanges <Boolean>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-SecurityPolicy

Detailed Description

This cmdlet modifies the security policy for virtual port groups or the default port security policy for virtual switches. Specifying a parameter automatically changes the parameter's Inherited setting to 'false'. Specifying the parameter's Inherited setting as 'true' automatically applies the switch level security policy to the parameter.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
VirtualPortGroupPolicyVirtualPortgroupSecurityPolicy[]Specifies the virtual port group security policy that you want to configure.truetrue (ByValue)
VirtualSwitchPolicyVirtualSwitchSecurityPolicy[]Specifies the virtual switch security policy that you want to configure.truetrue (ByValue)
AllowPromiscuousBooleanSpecifies whether promiscuous mode is enabled for the corresponding virtual port group or switch.falsefalse
AllowPromiscuousInheritedBooleanSpecifies whether the AllowPromiscuous setting is inherited from the parent virtual switch.falsefalse
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse
ForgedTransmitsBooleanSpecifies whether forged transmits are enabled for the corresponding virtual port group or switch.falsefalse
ForgedTransmitsInheritedBooleanSpecifies whether the ForgedTransmits setting is inherited from the parent virtual switch.falsefalse
MacChangesBooleanSpecifies whether MAC address changes are enabled for the corresponding virtual port group or switch.falsefalse
MacChangesInheritedBooleanSpecifies whether the MacChanges setting is inherited from the parent virtual switch.falsefalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

The modified VirtualSwitchSecurityPolicy or VirtualPortgroupSecurityPolicy objects

Notes

Examples

-------------- Example 1 --------------

Get-VirtualSwitch -Name "MyVirtualSwitch" | Get-SecurityPolicy | Set-SecurityPolicy -MacChanges $false

Retrieves a virtual switch named "MyVirtualSwitch" and updates its security policy to forbid MAC address changes.

-------------- Example 2 --------------

Get-VirtualPortgroup -Name "MyVirtualPortGroup" | Get-SecurityPolicy | Set-SecurityPolicy -ForgedTransmitsInherited $true

Retrieves a virtual port group named "MyVirtualPortGroup" and updates the security policy to inherit the setting value for controlling outbound frames filtering by MAC address from its parent.


Copyright © VMware, Inc. All rights reserved.