This is the built-in help made by Microsoft for the command 'Set-VMNetworkAdapterVlan', in PowerShell version 5 - as retrieved from
Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.
For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.
Configures the virtual LAN settings for the traffic through a virtual network adapter.
Set-VMNetworkAdapterVlan [-VMName] <String[]> [-Access] [-AllowedVlanIdList <String>] [-Community] [-ComputerName <String[]>] [-Isolated] [-NativeVlanId <Int32>] [-Passthru]
[-PrimaryVlanId <Int32>] [-Promiscuous] [-SecondaryVlanId <Int32>] [-SecondaryVlanIdList <String>] [-Trunk] [-Untagged] [-VlanId <Int32>] [-VMNetworkAdapterName <String>]
[-Confirm] [-WhatIf] [<CommonParameters>]
Set-VMNetworkAdapterVlan [-Access] [-AllowedVlanIdList <String>] [-Community] [-ComputerName <String[]>] [-Isolated] [-NativeVlanId <Int32>] [-Passthru] [-PrimaryVlanId
<Int32>] [-Promiscuous] [-SecondaryVlanId <Int32>] [-SecondaryVlanIdList <String>] [-Trunk] [-Untagged] [-VlanId <Int32>] [-VMNetworkAdapterName <String>] -ManagementOS
[-Confirm] [-WhatIf] [<CommonParameters>]
Set-VMNetworkAdapterVlan [-VM] <VirtualMachine[]> [-Access] [-AllowedVlanIdList <String>] [-Community] [-Isolated] [-NativeVlanId <Int32>] [-Passthru] [-PrimaryVlanId
<Int32>] [-Promiscuous] [-SecondaryVlanId <Int32>] [-SecondaryVlanIdList <String>] [-Trunk] [-Untagged] [-VlanId <Int32>] [-VMNetworkAdapterName <String>] [-Confirm]
[-WhatIf] [<CommonParameters>]
Set-VMNetworkAdapterVlan [-VMNetworkAdapter] <VMNetworkAdapterBase[]> [-Access] [-AllowedVlanIdList <String>] [-Community] [-Isolated] [-NativeVlanId <Int32>] [-Passthru]
[-PrimaryVlanId <Int32>] [-Promiscuous] [-SecondaryVlanId <Int32>] [-SecondaryVlanIdList <String>] [-Trunk] [-Untagged] [-VlanId <Int32>] [-Confirm] [-WhatIf]
[<CommonParameters>]
The Set-VMNetworkAdapterVlan cmdlet configures virtual LAN settings for the traffic through a virtual network adapter. Access, Trunk, Private VLAN (isolated, community, or
promiscuous), and untagged are mutually exclusive.
<
Online Version: http://go.microsoft.com/fwlink/?LinkID=306950
<
Example 1
PS C:\>Set-VMNetworkAdapterVlan –VMName Redmond –Access –VlanId 121
Sets the virtual network adapter(s) in virtual machine Redmond to the Access mode. Traffic sent by this virtual machine is tagged with VLAN ID 121.
Example 2
PS C:\>Set-VMNetworkAdapterVlan -VMName Redmond -Trunk -AllowedVlanIdList 1-100 -NativeVlanId 10
Sets the virtual network adapter(s) in virtual machine Redmond to the Trunk mode. Any traffic tagged with one of the VLAN IDs in the allowed VLAN list will be permitted to
be sent or received by the VLAN. If traffic is untagged, it will be treated as if it were on VLAN 10.
Example 3
PS C:\>Get-VMNetworkAdapter -VMName Redmond | Set-VMNetworkAdapterVlan -Isolated -PrimaryVlanId 10 -SecondaryVlanId 200
Gets the virtual network adapters from virtual machine Redmond and sets them to the Private VLAN isolated mode, where primary VLAN is 10 and the secondary VLAN is 200.
Example 4
PS C:\>Get-VMNetworkAdapter -VMName WA | Set-VMNetworkAdapterVlan -Promiscuous -PrimaryVlanId 10 -SecondaryVlanIdList 200-201
Gets the virtual network adapters from virtual machine WA and sets them to the Private VLAN promiscuous mode, where primary VLAN is 10 and the secondary VLANs are 201 and
202.
Example 5
PS C:\>Get-VM Redmond | Set-VMNetworkAdapterVlan -Untagged
Gets virtual machine Redmond and sets the virtual network adapters in the virtual machine to the untagged mode.