Get-VDSwitch

This cmdlet retrieves vSphere distributed switches.

Syntax

[-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
  • wildcards
  • pipeline
  • 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
  • wildcards
  • pipeline
  • Specifies virtual machines to retrieve vSphere distributed switches they are connected to.
    optional
    VMHost
    VMHost[] named
  • wildcards
  • pipeline
  • Specifies hosts to retrieve vSphere distributed switches to which the hosts are added.

    -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.
    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.

    -RelatedObject  <VDSwitchRelatedObjectBase[]>
    [CommonParameters]

    Parameters

    Required Parameter Name Type Position Features Description
    required
    RelatedObject
    VDSwitchRelatedObjectBase[] named
  • pipeline
  • Specifies an object to retrieve one or more vSphere distributed switches that are related to the object. This parameter accepts NetworkPool and OMResource objects.

    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

    Feedback

    Was this page helpful?