Get-SCVMHostNetworkAdapter

Get-SCVMHostNetworkAdapter

Gets physical network adapter objects on a VMM host.

Syntax

Parameter Set: NoFilter
Get-SCVMHostNetworkAdapter [[-Name] <String> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: FilterByVMHost
Get-SCVMHostNetworkAdapter [[-Name] <String> ] -VMHost <Host> [ <CommonParameters>]

Detailed Description

The Get-SCVMHostNetworkAdapter cmdlet gets one or more physical network adapter objects on a host managed by Virtual Machine Manager (VMM).

Parameters

-Name<String>

Specifies the name of a VMM object.

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMHost<Host>

Specifies a virtual machine host object. VMM supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts.

For more information about each type of host, type Get-Help Add-SCVMHost -detailed.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

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 (https://go.microsoft.com/fwlink/p/?LinkID=113216).

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.

  • HostNetworkAdapter

Examples

Example 1: Get all physical network adapters on the specified host

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

The second command gets all physical network adapter objects from VMHost01, and then stores the objects in the $HostAdapter variable.

The third command displays the name and connection state for each adapter.

PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> $HostAdapter = Get-SCVMHostNetworkAdapter -VMHost $VMHost
PS C:\> $HostAdapter | select -Property Name, ConnectionState

Example 2: Get all physical network adapters in the VMM database

This command gets all physical network adapter objects on all hosts managed by the VMM server, and then displays the name, MAC address, host name, and maximum bandwidth for each adapter.

PS C:\> Get-SCVMHostNetworkAdapter | Format-List Name, MacAddress, VMHost, MaxBandwidth

Example 3: Get a physical network adapter by name from a specific host

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

The second command gets the network adapter object named HostAdapter01 from VMHost01, and then stores the object in the $HostAdapter variable.

The third command passes the adapter object stored in $HostAdapter to the Format-List cmdlet, which displays the name, whether or not the virtual LAN is enabled, and the current value for the VLAN mode, either Trunk or Access.

PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> $HostAdapter = Get-SCVMHostNetworkAdapter -VMHost $VMHost -Name "HostAdapter01"
PS C:\> $HostAdapter | Format-List -Property Name,VLANEnabled,VLANMode

Example Example 4: Get each host network adapter that includes a string in its name.

This command gets host network adapter objects from VMMServer01 that include the string Broadcom in their name, and then displays the name and IP addresses for each adapter.

PS C:\> Get-SCVMHostNetworkAdapter -VMMServer "VMMServer01.Contoso.com" | where { $_.Name -match "Broadcom" } | Format-List -Property Name,IPAddresses

Add-SCVMHostNetworkAdapter

Remove-SCVMHostNetworkAdapter

Set-SCVMHostNetworkAdapter

Add-SCVMHost

Get-SCVMHost