New-SCLogicalSwitchVirtualNetworkAdapter

Adds a virtual network adapter (VNIC) to a logical switch.

Syntax

New-SCLogicalSwitchVirtualNetworkAdapter [-Name] <String> [[-Description] <String>]
 [-EthernetAddressType <EthernetAddressType>] [-IPv4AddressPool <StaticIPAddressPool>]
 [-IPv4AddressType <EthernetAddressType>] [-IPv6AddressPool <StaticIPAddressPool>]
 [-IPv6AddressType <EthernetAddressType>] [-InheritsAddressFromPhysicalNetworkAdapter <Boolean>]
 [-IsUsedForHostManagement <Boolean>] [-JobVariable <String>] [-PROTipID <Guid>]
 [-PortClassification <PortClassification>] [-RunAsynchronously] -UplinkPortProfileSet <UplinkPortProfileSet>
 [-VLanEnabled <Boolean>] [-VLanID <UInt16>] [-VMMServer <ServerConnection>] [-VMNetwork <VMNetwork>]
 [-VMSubnet <VMSubnet>] [<CommonParameters>]

Description

The New-SCLogicalSwitchVirtualNetworkAdapter cmdlet adds a virtual network adapter (VNIC) for the host to the Uplink Port Profile as part of the logical switch definition.

Examples

Example 1: Creates a new logical switch virtual network adapter

PS C:\> $UPPSet = Get-SCUplinkPortProfileSet -Name "R1Uplink"
PS C:\> $VmNetwork = Get-SCVMNetwork -Name "MgmtNet"
PS C:\> New-SCLogicalSwitchVirtualNetworkAdapter -Name "LogSw01_Storage" -UplinkPortProfileSet $uppSetVar -RunAsynchronously -VMNetwork $vmNetwork -VLanEnabled $true -VLanID 2162 -IsUsedForHostManagement $false -IPv4AddressType "Dynamic" -IPv6AddressType "Dynamic"

The first command gets an uplink port profile set by using the Get-SCUplinkPortProfileSet cmdlet, and then stores it in the $UPPSet variable.

The second command gets the virtual machine network named MgmtNet by using the Get-SCVMNetwork cmdlet, and then stores it in the $VmNetwork variable.

The final command creates a logical switch virtual network adapter that gets deployed to the host along with the logical switch.

Parameters

-Description

Specifies a description for the virtual network adapter.

Type:String
Required:False
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EthernetAddressType

Specifies an Ethernet address type. The acceptable values for this parameter are:

- Dynamic

  • Static

Type:EthernetAddressType
Parameter Sets:Dynamic, Static
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IPv4AddressPool

Specifies a static address pool that contains IPv4 addresses.

Type:StaticIPAddressPool
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IPv4AddressType

Specifies an IPv4 address type. The acceptable values for this parameter are:

- Dynamic

  • Static

Type:EthernetAddressType
Parameter Sets:Dynamic, Static
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IPv6AddressPool

Specifies a static address pool that contains IPv6 addresses.

Type:StaticIPAddressPool
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IPv6AddressType

Specifies an IPv6 address type. The acceptable values for this parameter are:

- Dynamic

  • Static

Type:EthernetAddressType
Parameter Sets:Dynamic, Static
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InheritsAddressFromPhysicalNetworkAdapter

Indicates whether the network adapter inherits its address from a physical network adapter.

Type:Boolean
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IsUsedForHostManagement

Indicates whether the virtual network adapter is used for host management.

Type:Boolean
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of the network adapter.

Type:String
Required:True
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PortClassification

Specifies the port classification of the switch to which the virtual network adapter connects.

Type:PortClassification
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UplinkPortProfileSet

Specifies an uplink port profile set object.

To obtain an uplink port profile set object, use the Get-SCUplinkPortProfileSet cmdlet.

Type:UplinkPortProfileSet
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VLanEnabled

Indicates whether to enable a virtual LAN (VLAN) for use by virtual machines on a Hyper-V or Citrix XenServer host.

- Example format for a single VLAN: -VLANEnabled -VLANMode "Access" -VLANID 35

  • Example format for multiple VLANs: -VLANEnabled -VLANMode "Trunk" -VLANTrunkID 1,2,100,200,1124

Type:Boolean
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VLanID

Assigns a numerical identifier in the range 1-4094 to a virtual network adapter on a virtual machine or to a physical network adapter on a virtual machine host.

Configure a VLanID on a Hyper-V, VMware ESX, or Citrix XenServer host on an externally bound physical network adapter when the VLan mode is Access.

Configure a VLanID on a virtual network adapter of a virtual machine bound to a physical network adapter on the host, or bound to an internal virtual network on the host.

Example format: -VLanEnabled -VLanMode "Access" -VLANID 35

Type:UInt16
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMNetwork

Specifies a VM network object.

To get a VM network object, use the Get-SCVMNetwork cmdlet.

Type:VMNetwork
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMSubnet

Specifies a virtual machine subnet object.

To obtain a VMSubnet object, use the Get-SCVMSubnet cmdlet.

Type:VMSubnet
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False