Get-VirtualPortGroup

Synopsis

Retrieves the available port groups of hosts, virtual machines, and virtual switches.

Syntax

Get-VirtualPortGroup [[-VMHost] <VMHost[]>] [-VM <VirtualMachine[]>] [-VirtualSwitch <VirtualSwitch[]>] [-Name <String[]>] [-Server <VIServer[]>] [<CommonParameters>]

Related Commands

New-VirtualPortGroup
Remove-VirtualPortGroup
Set-VirtualPortGroup

Detailed Description

Retrieves the available port groups of hosts, virtual machines, and virtual switches. To specify a server different from the default one, use the -Server parameter.

Parameters

NameDescriptionRequired?Pipeline InputDefault Value
VMHostSpecify the hosts whose port groups you want to retrieve.falsetrue (ByValue)
VMSpecify the virtual machines whose port groups you want to retrieve.falsetrue (ByValue)
VirtualSwitchSpecify the virtual switches whose port groups you want to retrieve.falsetrue (ByValue)
NameSpecify the names of the port groups you want to retrieve.falsefalse
ServerSpecify the vSphere servers 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

Input Type

Return Type

VMware.VimAutomation.Types.Host.VirtualPortGroup

Notes

Examples

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

C:\PS>$vmHost = Get-VMHost -Name 10.23.112.123 

$vs = New-VirtualSwitch -VMHost $vmHost -Name Switch02

New-VirtualPortGroup -VirtualSwitch $vs -Name VS02-12

Get-VirtualPortGroup -VirtualSwitch $vs


Creates a virtual switch named Switch02 on the virtual machine host with IP addr
ess 10.23.112.123. Creates a new virtual ports group named VS02-12 for the new s
witch. Retrieves the virtual ports groups of Switch02.

Copyright © 1998 - 2009 VMware, Inc. All rights reserved.