Syntax
Get-VirtualNetwork -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>]Related Commands
Detailed 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
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name | String[] | Specifies the names of the virtual networks that you want to retrieve. | false | False | |
Id | String[] | Specifies the IDs of the virtual networks that you want to retrieve. | true | False | |
Location | VIContainer[] | Specifies vSphere container objects that you want to search for virtual networks. This parameter accepts ResourcePool, VApp, VMHost, Folder, Cluster, and Datacenter objects. | false | True (ByValue) | |
NetworkType | NetworkType[] | Specifies the network types of the virtual networks that you want to retrieve. The accepted values are Network, Distributed, and Opaque. | false | False | |
NoRecursion | SwitchParameter | Indicates that you want to disable the recursive behavior of the command. | false | 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. | false | False |
Return Type
Zero or more Network objectsNotes
Examples
-------------------------- 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.