Freigeben über


New-SCLogicalSwitchVirtualNetworkAdapter

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

Syntax

Default (Default)

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

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

-EthernetAddressType

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

  • Dynamic
  • Static

Parameter properties

Type:EthernetAddressType
Default value:None
Accepted values:Dynamic, Static
Supports wildcards:False
DontShow:False

Parameter sets

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

-InheritsAddressFromPhysicalNetworkAdapter

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

Parameter properties

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

Parameter sets

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

-IPv4AddressPool

Specifies a static address pool that contains IPv4 addresses.

Parameter properties

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

Parameter sets

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

-IPv4AddressType

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

  • Dynamic
  • Static

Parameter properties

Type:EthernetAddressType
Default value:None
Accepted values:Dynamic, Static
Supports wildcards:False
DontShow:False

Parameter sets

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

-IPv6AddressPool

Specifies a static address pool that contains IPv6 addresses.

Parameter properties

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

Parameter sets

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

-IPv6AddressType

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

  • Dynamic
  • Static

Parameter properties

Type:EthernetAddressType
Default value:None
Accepted values:Dynamic, Static
Supports wildcards:False
DontShow:False

Parameter sets

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

-IsUsedForHostManagement

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

Parameter properties

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

Parameter sets

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

-JobVariable

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

Parameter properties

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

Parameter sets

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

-Name

Specifies the name of the network adapter.

Parameter properties

Type:String
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

-PortClassification

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

Parameter properties

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

Parameter sets

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

Parameter properties

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

Parameter sets

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

-RunAsynchronously

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

Parameter properties

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

Parameter sets

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

-UplinkPortProfileSet

Specifies an uplink port profile set object.

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

Parameter properties

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

Parameter sets

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

Parameter properties

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

Parameter sets

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

Parameter properties

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

Parameter sets

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

-VMMServer

Specifies a VMM server object.

Parameter properties

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

Parameter sets

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

-VMNetwork

Specifies a VM network object.

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

Parameter properties

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

Parameter sets

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

-VMSubnet

Specifies a virtual machine subnet object.

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

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
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.