Get-SCVMHostNetworkAdapter
Gets physical network adapter objects on a VMM host.
Syntax
Get-SCVMHostNetworkAdapter
[-VMMServer <ServerConnection>]
[[-Name] <String>]
[<CommonParameters>]
Get-SCVMHostNetworkAdapter
-ID <Guid>
[[-Name] <String>]
[<CommonParameters>]
Get-SCVMHostNetworkAdapter
-VMHost <Host>
[[-Name] <String>]
[<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.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies the name of a VMM object.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | 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.
Type: | Host |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMMServer
Specifies a VMM server object.
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Outputs
HostNetworkAdapter
The cmdlet returns a HostNetworkAdapter object.