Set-SecurityPolicy Command | Vmware PowerCLI Reference

Set-SecurityPolicy

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.

Syntax

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

Parameters

Required Parameter Name Type Position Features Description
required
VirtualPortGroupPolicy VirtualPortgroupSecurityPolicy[] named
  • pipeline
Specifies the virtual port group security policy that you want to configure.
optional AllowPromiscuous Boolean named
Specifies whether promiscuous mode is enabled for the corresponding virtual port group or switch.
optional AllowPromiscuousInherited Boolean named
Specifies whether the AllowPromiscuous setting is inherited from the parent virtual switch.
optional ForgedTransmits Boolean named
Specifies whether forged transmits are enabled for the corresponding virtual port group or switch.
optional ForgedTransmitsInherited Boolean named
Specifies whether the ForgedTransmits setting is inherited from the parent virtual switch.
optional MacChanges Boolean named
Specifies whether MAC address changes are enabled for the corresponding virtual port group or switch.
optional MacChangesInherited Boolean named
Specifies whether the MacChanges setting is inherited from the parent virtual switch.
Set-SecurityPolicy
-VirtualSwitchPolicy < VirtualSwitchSecurityPolicy[] >
[-AllowPromiscuous < Boolean > ]
[-ForgedTransmits < Boolean > ]
[-MacChanges < Boolean > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
VirtualSwitchPolicy VirtualSwitchSecurityPolicy[] named
  • pipeline
Specifies the virtual switch security policy that you want to configure.
optional AllowPromiscuous Boolean named
Specifies whether promiscuous mode is enabled for the corresponding virtual port group or switch.
optional ForgedTransmits Boolean named
Specifies whether forged transmits are enabled for the corresponding virtual port group or switch.
optional MacChanges Boolean named
Specifies whether MAC address changes are enabled for the corresponding virtual port group or switch.

Output

VMware.VimAutomation.ViCore.Types.V1.Host.Networking.SecurityPolicy

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.

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.