PowerCLI Reference

Get-VDSwitch

Synopsis

This cmdlet retrieves vSphere distributed switches.

Syntax

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

Get-VDSwitch [[-Name] <String[]>] [-Location <FolderContainer[]>] [-Server <VIServer[]>] [-Tag <Tag[]>] [-VM <VirtualMachine[]>] [-VMHost <VMHost[]>] [<CommonParameters>]

Get-VDSwitch -RelatedObject <VDSwitchRelatedObjectBase[]> [<CommonParameters>]

Related Commands

Online Version
Remove-VDSwitch
New-VDSwitch
Set-VDSwitch
Export-VDSwitch

Detailed Description

This cmdlet retrieves vSphere distributed switches.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
NameString[]Specifies the names of the vSphere distributed switches that you want to retrieve.falseFalse
IdString[]Specifies the IDs of the vSphere distributed switches 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
LocationFolderContainer[]Specifies vCenter Server container objects that you want to search for vSphere distributed switches. This parameter accepts Datacenter and Folder objects.falseTrue (ByValue)
RelatedObjectVDSwitchRelatedObjectBase[]Specifies an object to retrieve one or more vSphere distributed switches that are related to the object. This parameter accepts NetworkPool and OMResource objects.trueTrue (ByValue)
ServerVIServer[]Specify the cloud 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-CIServer.falseFalse
TagTag[]Returns only the vSphere distributed switches that are associated with any of the specified tags.falseFalse
VMVirtualMachine[]Specifies virtual machines to retrieve vSphere distributed switches they are connected to.falseTrue (ByValue)
VMHostVMHost[]Specifies hosts to retrieve vSphere distributed switches to which the hosts are added.falseTrue (ByValue)

Return Type

Zero or more VDSwitch objects

Notes

Examples

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

Get-Datacenter -Name MyDatacenter | Get-VDSwitch

Retrieves all vSphere distributed switches in the specified datacenter.

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

Get-VMHost -Name MyVMHost | Get-VDSwitch

Retrieves all vSphere distributed switches to which the specified host is added.

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

Get-VM -Name MyVM | Get-VDSwitch

Retrieves all vSphere distributed switches to which the specified virtual machine is connected.


Copyright © VMware, Inc. All rights reserved.