Edit

Share via


New-NetworkSwitchVlan

Creates a VLAN for a network switch.

Syntax

Default (Default)

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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:CimSession
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Description

Specifies a description of the new VLAN.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:4
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VlanID

Specifies a VLAN ID for the new VLAN.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

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

Inputs

None

Outputs

Object