PowerCLI Reference

Get-VDPortgroup

Synopsis

This cmdlet retrieves distributed port groups.

Syntax

Get-VDPortgroup [[-Name] <String[]>] [-NetworkAdapter <NetworkAdapter[]>] [-VDSwitch <VDSwitch[]>] [-VMHostNetworkAdapter <HostVirtualNic[]>] [-Server <VIServer[]>] [-Tag <Tag[]>] [<CommonParameters>]

Get-VDPortgroup -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>]

Get-VDPortgroup -RelatedObject <VDPortgroupRelatedObjectBase[]> [<CommonParameters>]

Related Commands

Online version
New-VDPortgroup
Remove-VDPortgroup
Set-VDPortgroup
Export-VDPortgroup

Detailed Description

This cmdlet retrieves distributed port groups.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
NameString[]Specifies the names of the distributed port groups that you want to retrieve.falsefalse
IdString[]Specifies the IDs of the distributed port groups that you want to retrieve.

Note: When a list of values is specified for the Id parameter, the returned objects would have an ID that matches exactly one of the string values in that list.
truefalse
NetworkAdapterNetworkAdapter[]Specifies a virtual machine network adapter to retrieve the distributed port group to which the network adapter is connected.falsetrue (ByValue)
RelatedObjectVDPortgroupRelatedObjectBase[]Specifies an object to retrieve one or more distributed port groups that are related to the object. This parameter accepts ExternalNetwork, OrgNetwork, NetworkPool, and OMResource objects.truetrue (ByValue)
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsefalse
TagTag[]Returns only the distributed port groups that are associated with any of the specified tags.falsefalse
VDSwitchVDSwitch[]Specifies a vSphere distributed switch to retrieve the distributed port groups that belong to the switch.falsetrue (ByValue)
VMHostNetworkAdapterHostVirtualNic[]Specifies a host virtual network adapter to retrieve the distributed port groups to which the network adapter is connected.falsetrue (ByValue)

Return Type

Zero or more VDPortgroup objects

Notes

Examples

-------------- Example 1 --------------

Get-VDPortGroup -Name "MyVDPortGroup" -VDSwitch "MyVDSwitch"

Retrieves the distributed port group named "MyVDPortGroup" on the specified vSphere distributed switch.

-------------- Example 2 --------------

Get-OrgNetwork -Name "MyOrgNetwork" | Get-VDPortGroup

Retrieves the distributed port groups that are related to the specified organization network in the cloud.

-------------- Example 3 --------------

Get-NetworkAdapter -Name "MyVMNetworkAdapter" | Get-VDPortGroup

Retrieves the distributed port group to which the specified virtual machine network adapter is connected.


Copyright © VMware, Inc. All rights reserved.