Share via


Get-SCVMHostNetworkAdapter

Gets physical network adapter objects on a VMM host.

Syntax

NoFilter (Default)

Get-SCVMHostNetworkAdapter
    [[-Name] <String>]
    [-VMMServer <ServerConnection>]
    [<CommonParameters>]

ByID

Get-SCVMHostNetworkAdapter
    [[-Name] <String>]
    -ID <Guid>
    [<CommonParameters>]

FilterByVMHost

Get-SCVMHostNetworkAdapter
    [[-Name] <String>]
    -VMHost <Host>
    [<CommonParameters>]

Description

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

Examples

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

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

The first command gets the host object named VMHost01 and 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.

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

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

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

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

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

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

The second command gets the network adapter object named HostAdapter01 from VMHost01 and 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).

Example 4: Get each host network adapter that includes "Broadcom" in its name

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

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.

Parameters

-ID

Specifies the numerical identifier as a globally unique identifier, or GUID, for a specific object.

Parameter properties

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

Parameter sets

ByID
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of a VMM object.

Parameter properties

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

Parameter sets

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

-VMHost

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, see the Add-SCVMHost cmdlet.

Parameter properties

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

Parameter sets

FilterByVMHost
Position:Named
Mandatory:True
Value from pipeline:True
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

NoFilter
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.

Outputs

HostNetworkAdapter

The cmdlet returns a HostNetworkAdapter object.