< Back

Get-VirtualNetwork

Sun Jan 19, 2020 6:54 pm

NAME Get-VirtualNetwork



SYNOPSIS

The cmdlet retrieves all virtual networks on a vCenter server system.





SYNTAX

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



Get-VirtualNetwork [[-Name] <String[]>] [-Location <VIContainer[]>] [-NetworkType {Network | Distributed |

Opaque}] [-NoRecursion] [-Server <VIServer[]>] [<CommonParameters>]





DESCRIPTION

This cmdlet retrieves all virtual networks that match the specified filters for each default connection to the

vCenter server system or all specified connections in the -Server parameter.





PARAMETERS

-Id <String[]>

Specifies the IDs of the virtual networks that you want to retrieve.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Location <VIContainer[]>

Specifies vSphere container objects that you want to search for virtual networks. This parameter accepts

Folder and Datacenter objects.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Name <String[]>

Specifies the names of the virtual networks that you want to retrieve.



Required? false

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-NetworkType <NetworkType[]>

Specifies the network types of the virtual networks that you want to retrieve. The accepted values are

Network, Distributed, and Opaque.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NoRecursion [<SwitchParameter>]

Indicates that you want to disable the recursive behavior of the command.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Server <VIServer[]>

Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this

parameter, the command runs on the default servers. For more information about default servers, see the

description of the Connect-VIServer cmdlet.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Zero or more Network objects







NOTES









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



$networks = Get-VirtualNetwork



Retrieves all virtual networks on a vCenter server system.

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



$networks = Get-VirtualNetwork -Name 'VM*'



Retrieves all virtual networks whose names begin with 'VM'.

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



$networks = Get-VirtualNetwork -NetworkType Distributed



Retrieves all distributed networks on the vCenter server system.

-------------------------- Example 4 --------------------------



$networks = Get-VirtualNetwork -Id 'network_id'



Retrieves a virtual network by Id.



RELATED LINKS