Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Disconnect-VMNetworkAdapter

Published: August 15, 2012

Updated: September 5, 2013

Applies To: Windows Server 2012

Disconnect-VMNetworkAdapter

Disconnects a virtual network adapter from a virtual switch or Ethernet resource pool.

Syntax

Parameter Set: Name
Disconnect-VMNetworkAdapter [-VMName] <String[]> [[-Name] <String[]> ] [-ComputerName <String[]> ] [-Passthru] [ <CommonParameters>]

Parameter Set: Obj
Disconnect-VMNetworkAdapter [-VMNetworkAdapter] <VMNetworkAdapter[]> [-Passthru] [ <CommonParameters>]




Detailed Description

The Disconnect-VMNetworkAdapter cmdlet disconnects a virtual network adapter from a virtual switch or Ethernet resource pool.

Parameters

-ComputerName<String[]>

Specifies one or more Hyper-V hosts on which a virtual network adapter is to be disconnected. NetBIOS names, IP addresses, and fully-qualified domain names are allowable. The default is the local computer — use “localhost” or a dot (“.”) to specify the local computer explicitly.


Aliases

none

Required?

false

Position?

named

Default Value

.

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String[]>

Specifies the name of the virtual network adapter to be disconnected.


Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Passthru

Specifies that a Microsoft.Virtualization.Powershell.VMNetworkAdapter object is to be passed through to the pipeline representing the virtual network adapter to be disconnected.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMName<String[]>

Specifies the name of the virtual machine in which the virtual network adapter is to be disconnected.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMNetworkAdapter<VMNetworkAdapter[]>

Specifies the virtual network adapter to be disconnected.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • None by default; Microsoft.Virtualization.Powershell.VMNetworkAdapter if –PassThru is specified.


Examples

Example 1

Disconnects virtual network adapter Test1.


PS C:\> Disconnect-VMNetworkAdapter -VMNetworkAdapter Test1

Example 2

Disconnects all virtual network adapters whose SwitchName is InternetAccess in all virtual machines on the local Hyper-V server.


PS C:\> Get-VMNetworkAdapter -VMName * | Where-Object {$_.SwitchName -eq 'InternetAccess'} | Disconnect-VMNetworkAdapter

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.