Table of contents
TLS
TOC
Collapse the table of content
Expand the table of content

New-NetworkSwitchVlan

Brian Lich|Last Updated: 3/31/2017

SYNOPSIS

Creates a VLAN for a network switch.

SYNTAX

New-NetworkSwitchVlan [-CimSession] <CimSession> [[-Caption] <String>] [[-Description] <String>]
 [-VlanID] <Int32> [-Name] <String> [<CommonParameters>]

DESCRIPTION

The New-NetworkSwitchVlan cmdlet creates a virtual local area network (VLAN) for a network switch.

EXAMPLES

Example 1: Create a VLAN

PS C:\>$Session = New-CimSession -ComputerName "NetworkSwitch08"
PS C:\> New-NetworkSwitchVlan -Name "Contoso07VLAN" -Caption "VLAN 07" -CimSession $Session
Caption             Description         ElementName         InstanceID                       VlanID PSComputerName    
-------             -----------         -----------         ----------                       ------ --------------    
VLAN 07                                 VLAN0004            Contoso:NetworkVL...                  4 10.19.26.4

The first command creates a CimSession for a network switch, and then stores it in the $Session variable. For more information about CimSession objects, type Get-Help New-CimSession.

The second creates a VLAN for the switch NetworkSwitch08 by using the $Session object.

PARAMETERS

-Caption

Specifies a caption for the new VLAN.

Type: String
Parameter Sets: (All)
Aliases: 

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-CimSession

Specifies the CimSession that this cmdlet uses to connect to the network switch. For more information about CimSession objects, type Get-Help New-CimSession.

Type: CimSession
Parameter Sets: (All)
Aliases: 

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Description

Specifies a description of the new VLAN.

Type: String
Parameter Sets: (All)
Aliases: 

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Name

Specifies a name to use as the VLAN ElementName. This is a friendly name.

Type: String
Parameter Sets: (All)
Aliases: 

Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-VlanID

Specifies a VLAN ID for the new VLAN.

Type: Int32
Parameter Sets: (All)
Aliases: 

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

None

This cmdlet does not generate any output.

NOTES

Disable-NetworkSwitchVlan

Enable-NetworkSwitchVlan

Get-NetworkSwitchVlan

Remove-NetworkSwitchVlan

Set-NetworkSwitchVlanProperty

© 2017 Microsoft