< Back
Add-VirtualSwitchPhysicalNetworkAdapter
Post
NAME Add-VirtualSwitchPhysicalNetworkAdapter
SYNOPSIS
This cmdlet adds a host physical NIC to a standard virtual switch.
SYNTAX
Add-VirtualSwitchPhysicalNetworkAdapter [-VMHostPhysicalNic] <PhysicalNic[]> [-VirtualSwitch] <VirtualSwitch>
[-Server <VIServer[]>] [-VirtualNicPortgroup <VirtualPortGroup[]>] [-VMHostVirtualNic <HostVirtualNic[]>]
[-Confirm] [-WhatIf] [<CommonParameters>]
DESCRIPTION
This cmdlet adds a host physical NIC to a standard virtual switch. If VMHost virtual network adapters are
specified, the cmdlet migrates them to the virtual switch as well.
Note: If VMHost virtual network adapters are specified, the cmdlet migrates them to the respective port groups or
creates new ones if VirtualNicPortgroup is not specified.
PARAMETERS
-Server <VIServer[]>
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this
parameter, the command runs on the default servers. For more information about default servers, see the
description of Connect-VIServer.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-VirtualNicPortgroup <VirtualPortGroup[]>
Specifies the port groups to which to attach the host virtual network adapters. Accepts the same number of
port groups as the number of virtual network adapters specified. The first adapter is attached to the first
port group, the second adapter - to the second port group, and so on.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-VirtualSwitch <VirtualSwitch>
Specifies the standard virtual switch to which you want to migrate physical or virtual network adapters.
Required? true
Position? 2
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-VMHostPhysicalNic <PhysicalNic[]>
Specifies the host physical network adapters that you want to add or migrate to the standard virtual switch.
Required? true
Position? 1
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-VMHostVirtualNic <HostVirtualNic[]>
Specifies the host virtual network adapters to be migrated along with the physical adapter, so that their
connectivity is preserved.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false,
the cmdlet runs without asking for user confirmation.
Required? false
Position? named
Default value $true
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are
modified.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
None
NOTES
-------------------------- Example 1 --------------------------
$myVMHostNetworkAdapter = Get-VMhost "MyVMHost" | Get-VMHostNetworkAdapter -Physical -Name vmnic2
Get-VirtualSwitch "MyVirtualSwitch" | Add-VirtualSwitchPhysicalNetworkAdapter -VMHostPhysicalNic
$myVMHostNetworkAdapter
Adds a VMHost physical network adapter to the specified distributed switch.
-------------------------- Example 2 --------------------------
$myVMHost = Get-VMHost 'MyVMHost'
$myVDSwitch = Get-VDSwitch 'MyVDSwitch'
$physicalNic = Get-VMHostNetworkAdapter -VMHost $myVMHost -VirtualSwitch $myVDSwitch -Name 'vmnic0'
$virtualNic = Get-VMHostNetworkAdapter -VMHost $myVMHost -VirtualSwitch $myVDSwitch -Name 'vmk0'
$myStandardSwitch = Get-VirtualSwitch -VMHost $myVMHost -Name 'vSwitch0'
Add-VirtualSwitchPhysicalNetworkAdapter -VirtualSwitch $myStandardSwitch -VMHostPhysicalNic $physicalNic
-VMHostVirtualNic $virtualNic
Migrates VMHost physical and virtual network adapters from a distributed virtual switch to a standard virtual
switch.
RELATED LINKS
Online Version: https://code.vmware.com/doc/preview?id= ... apter.html
Remove-VirtualSwitchPhysicalNetworkAdapter
SYNOPSIS
This cmdlet adds a host physical NIC to a standard virtual switch.
SYNTAX
Add-VirtualSwitchPhysicalNetworkAdapter [-VMHostPhysicalNic] <PhysicalNic[]> [-VirtualSwitch] <VirtualSwitch>
[-Server <VIServer[]>] [-VirtualNicPortgroup <VirtualPortGroup[]>] [-VMHostVirtualNic <HostVirtualNic[]>]
[-Confirm] [-WhatIf] [<CommonParameters>]
DESCRIPTION
This cmdlet adds a host physical NIC to a standard virtual switch. If VMHost virtual network adapters are
specified, the cmdlet migrates them to the virtual switch as well.
Note: If VMHost virtual network adapters are specified, the cmdlet migrates them to the respective port groups or
creates new ones if VirtualNicPortgroup is not specified.
PARAMETERS
-Server <VIServer[]>
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this
parameter, the command runs on the default servers. For more information about default servers, see the
description of Connect-VIServer.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-VirtualNicPortgroup <VirtualPortGroup[]>
Specifies the port groups to which to attach the host virtual network adapters. Accepts the same number of
port groups as the number of virtual network adapters specified. The first adapter is attached to the first
port group, the second adapter - to the second port group, and so on.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-VirtualSwitch <VirtualSwitch>
Specifies the standard virtual switch to which you want to migrate physical or virtual network adapters.
Required? true
Position? 2
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-VMHostPhysicalNic <PhysicalNic[]>
Specifies the host physical network adapters that you want to add or migrate to the standard virtual switch.
Required? true
Position? 1
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-VMHostVirtualNic <HostVirtualNic[]>
Specifies the host virtual network adapters to be migrated along with the physical adapter, so that their
connectivity is preserved.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false,
the cmdlet runs without asking for user confirmation.
Required? false
Position? named
Default value $true
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are
modified.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
None
NOTES
-------------------------- Example 1 --------------------------
$myVMHostNetworkAdapter = Get-VMhost "MyVMHost" | Get-VMHostNetworkAdapter -Physical -Name vmnic2
Get-VirtualSwitch "MyVirtualSwitch" | Add-VirtualSwitchPhysicalNetworkAdapter -VMHostPhysicalNic
$myVMHostNetworkAdapter
Adds a VMHost physical network adapter to the specified distributed switch.
-------------------------- Example 2 --------------------------
$myVMHost = Get-VMHost 'MyVMHost'
$myVDSwitch = Get-VDSwitch 'MyVDSwitch'
$physicalNic = Get-VMHostNetworkAdapter -VMHost $myVMHost -VirtualSwitch $myVDSwitch -Name 'vmnic0'
$virtualNic = Get-VMHostNetworkAdapter -VMHost $myVMHost -VirtualSwitch $myVDSwitch -Name 'vmk0'
$myStandardSwitch = Get-VirtualSwitch -VMHost $myVMHost -Name 'vSwitch0'
Add-VirtualSwitchPhysicalNetworkAdapter -VirtualSwitch $myStandardSwitch -VMHostPhysicalNic $physicalNic
-VMHostVirtualNic $virtualNic
Migrates VMHost physical and virtual network adapters from a distributed virtual switch to a standard virtual
switch.
RELATED LINKS
Online Version: https://code.vmware.com/doc/preview?id= ... apter.html
Remove-VirtualSwitchPhysicalNetworkAdapter