Share via


Get-SCVirtualNetworkAdapter

Gets VMM virtual network adapter objects from a virtual machine, virtual machine template, or hardware profile.

Syntax

All

Get-SCVirtualNetworkAdapter
    [-VMMServer <ServerConnection>]
    [-All]
    [-ParentTypeVMOrHost]
    [-OnBehalfOfUser <String>]
    [-OnBehalfOfUserRole <UserRole>]
    [<CommonParameters>]

HardwareProfile

Get-SCVirtualNetworkAdapter
    -HardwareProfile <HardwareProfile>
    [-VMMServer <ServerConnection>]
    [-OnBehalfOfUser <String>]
    [-OnBehalfOfUserRole <UserRole>]
    [<CommonParameters>]

VM

Get-SCVirtualNetworkAdapter
    -VM <VM>
    [-VMMServer <ServerConnection>]
    [-OnBehalfOfUser <String>]
    [-OnBehalfOfUserRole <UserRole>]
    [<CommonParameters>]

Template

Get-SCVirtualNetworkAdapter
    -VMTemplate <Template>
    [-VMMServer <ServerConnection>]
    [-OnBehalfOfUser <String>]
    [-OnBehalfOfUserRole <UserRole>]
    [<CommonParameters>]

VMHost

Get-SCVirtualNetworkAdapter
    -VMHost <Host>
    [-VMMServer <ServerConnection>]
    [-OnBehalfOfUser <String>]
    [-OnBehalfOfUserRole <UserRole>]
    [<CommonParameters>]

ID

Get-SCVirtualNetworkAdapter
    [-ID] <Guid>
    [[-Name] <String>]
    [-VMMServer <ServerConnection>]
    [-OnBehalfOfUser <String>]
    [-OnBehalfOfUserRole <UserRole>]
    [<CommonParameters>]

Description

The Get-SCVirtualNetworkAdapter cmdlet gets one or more virtual network adapter objects from a virtual machine object, a virtual machine template object, or a hardware profile object in a Virtual Machine Manager (VMM) environment.

Examples

Example 1: Get virtual network adapters from a virtual machine

PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> Get-SCVirtualNetworkAdapter -VM $VM

The first command gets the virtual machine object named VM01 and stores the object in the $VM variable.

The second command gets all virtual network adapter objects on VM01 and displays information about the adapters to the user.

Example 2: Get virtual network adapters from a virtual machine template

PS C:\> $VMTemplate = Get-SCVMTemplate | where { $_.Name -eq "VMTemplate01" }
PS C:\> Get-SCVirtualNetworkAdapter -Template $VMTemplate

The first command gets all virtual machine template objects from the VMM library, selects the template object named VMTemplate01, and stores the object in the $VMTemplate variable.

The last command gets all virtual network adapter objects VMTemplate01 and displays information about these adapters to the user.

Example 3: Get virtual network adapters from a hardware profile

PS C:\> $HWProfile = Get-SCHardwareProfile | where { $_.Name -eq "NewHWProfile01" }
PS C:\> Get-SCVirtualNetworkAdapter -HardwareProfile $HWProfile

The first command gets all hardware profile objects in the VMM library, selects the profile object named NewHWProfile01, and then stores the object in the $HWProfile variable.

The second command gets all virtual network adapter objects NewHWProfile01 and displays information about these adapters to the user.

Parameters

-All

Indicates that this cmdlet gets all subordinate objects independent of the parent object.

For example, the command Get-SCVirtualDiskDrive -All gets all virtual disk drive objects regardless of the virtual machine object or template object that each virtual disk drive object is associated with.

Parameter properties

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

Parameter sets

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

-HardwareProfile

Specifies a hardware profile object.

Parameter properties

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

Parameter sets

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

-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

ID
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of a network object.

Parameter properties

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

Parameter sets

ID
Position:1
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-OnBehalfOfUser

Specifies a user name. This cmdlet operates on behalf of the user that this parameter specifies.

Parameter properties

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

Parameter sets

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

-OnBehalfOfUserRole

Specifies a user role. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

Parameter properties

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

Parameter sets

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

-ParentTypeVMOrHost

Indicates that the parent type is a virtual machine or a host.

Parameter properties

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

Parameter sets

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

-VM

Specifies a virtual machine object.

Parameter properties

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

Parameter sets

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

VMHost
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

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

-VMTemplate

Specifies a VMM template object used to create virtual machines.

Parameter properties

Type:Template
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Template

Parameter sets

Template
Position:Named
Mandatory:True
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

VirtualNetworkAdapter

This cmdlet returns a VirtualNetworkAdapter object.

Notes

  • Requires a VMM virtual machine object, virtual machine template object, or hardware profile object, which can be retrieved by using the Get-SCVirtualMachine, Get-SCVMTemplate, or Get-SCHardwareProfile cmdlets, respectively.