Get-VDSwitch Command | Vmware PowerCLI Reference

Get-VDSwitch

This cmdlet retrieves vSphere distributed switches.

Syntax

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

Parameters

Required Parameter Name Type Position Features Description
required
Id String[] named
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.
optional Server VIServer[] named
  • wildcards
Specify the cloud servers on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-CIServer.
Get-VDSwitch
[-Location < FolderContainer[] > ]
[-Name < String[] > ]
[-Server < VIServer[] > ]
[-Tag < Tag[] > ]
[-VM < VirtualMachine[] > ]
[-VMHost < VMHost[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
optional Location FolderContainer[] named
  • pipeline
  • wildcards
Specifies vCenter Server container objects that you want to search for vSphere distributed switches. This parameter accepts Datacenter and Folder objects.
optional Name String[] named
  • wildcards
Specifies the names of the vSphere distributed switches that you want to retrieve.
optional Server VIServer[] named
  • wildcards
Specify the cloud servers on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-CIServer.
optional Tag Tag[] named
Returns only the vSphere distributed switches that are associated with any of the specified tags.
optional VM VirtualMachine[] named
  • pipeline
  • wildcards
Specifies virtual machines to retrieve vSphere distributed switches they are connected to.
optional VMHost VMHost[] named
  • pipeline
  • wildcards
Specifies hosts to retrieve vSphere distributed switches to which the hosts are added.

Output

VMware.VimAutomation.Vds.Types.V1.VDSwitch

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.

Related Commands

VDSwitch

This cmdlet exports the configuration of a specified vSphere distributed switch to a .zip file.

This cmdlet retrieves vSphere distributed switches.

This cmdlet creates vSphere distributed switches.

This cmdlet removes vSphere distributed switches.

This cmdlet modifies the configuration of vSphere distributed switches.

VDSwitchPhysicalNetworkAdapter

This cmdlet adds host physical network adapters to a vSphere distributed switch.

This cmdlet removes host physical network adapters from the vSphere distributed switches they are connected to.

VDSwitchPrivateVlan

This cmdlet retrieves the private VLAN configuration entries of a vSphere distributed switch.

This cmdlet creates private VLAN configuration entries on a vSphere distributed switch.

This cmdlet removes private VLAN configuration entries from vSphere distributed switches.

VDSwitchVMHost

This cmdlet adds hosts to the specified vSphere distributed switch.

This cmdlet removes hosts from the specified vSphere distributed switches.