Remove-SCVMHostNetworkAdapter

Removes a physical host network adapter object from a virtual network that is configured on a host managed by VMM.

Syntax

Remove-SCVMHostNetworkAdapter
      [-VirtualNetwork] <VirtualNetwork>
      -VMHostNetworkAdapter <HostNetworkAdapter>
      [-JobGroup <Guid>]
      [-RunAsynchronously]
      [-PROTipID <Guid>]
      [-JobVariable <String>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-SCVMHostNetworkAdapter cmdlet removes one or more physical host network adapter objects from a virtual network that is configured on a host managed by Virtual Machine Manager (VMM).

Examples

Example 1: Remove the physical host network adapter from a specific virtual network

PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com" 
PS C:\> $HostAdapter = Get-SCVMHostNetworkAdapter -VMHost $VMHost -Name "HostAdapter01"
PS C:\> $VirtualNetwork = Get-SCVirtualNetwork -VMHost $VMHost -Name "ExternalVirtualNetwork01"
PS C:\> Remove-SCVMHostNetworkAdapter -VMHostNetworkAdapter $HostAdapter -VirtualNetwork $VirtualNetwork -Confirm

The first command gets the host object named VMHost01 and stores the object in the $VMHost variable.

The second command gets the host network adapter object named HostAdapter01 and stores the object in the $HostAdapter variable.

The third command gets the virtual network object named ExternalVirtualNetwork01 from VMHost01 and stores the object in the $VirtualNetwork variable.

The last command removes the host network adapter stored in $HostAdapter from the virtual network stored in $VirtualNetwork. The Confirm parameter prompts you to confirm whether you want to delete the adapter from VMM.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-JobGroup

Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.

Type:Guid
Position:Named
Default value:None
Required:False
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
Position:Named
Default value:None
Required:False
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
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

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

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

-VirtualNetwork

Specifies a virtual network object.

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

-VMHostNetworkAdapter

Specifies a physical network adapter object on a host to which virtual machines deployed on that host can connect.

Example format: -VMHostNetworkAdapter $VMHostNIC

Type:HostNetworkAdapter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False