Get-SCVirtualNetwork
Gets virtual network objects configured on a VMM host.
Syntax
NoFilter (Default)
Get-SCVirtualNetwork
[[-Name] <String>]
[-VMMServer <ServerConnection>]
[<CommonParameters>]
Cluster
Get-SCVirtualNetwork
[[-Name] <String>]
-VMHostCluster <HostCluster>
[<CommonParameters>]
ByID
Get-SCVirtualNetwork
[[-Name] <String>]
-ID <Guid>
[<CommonParameters>]
FilterByVMHost
Get-SCVirtualNetwork
[[-Name] <String>]
-VMHost <Host>
[<CommonParameters>]
Description
The Get-SCVirtualNetwork cmdlet gets one or more virtual network objects configured on a host managed by Virtual Machine Manager (VMM).
For information about virtual networks in VMM, type Get-Help New-SCVirtualNetwork -Detailed
.
Examples
Example 1: Get all virtual networks in the VMM database
PS C:\> $VirtualNetworks = Get-SCVirtualNetwork
PS C:\> $VirtualNetworks | Format-List Name,VMHost,VMHostNetworkadapters
The first command gets all virtual network objects on all hosts managed by VMM and stores the virtual network objects in $VirtualNetworks.
The second command displays a subset of information about each virtual network object in $VirtualNetworks: the name of each virtual network, the physical host on which each virtual network is configured, and the physical network adapters configured on the host for each virtual network.
Example 2: Get all virtual networks on a specific host
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> Get-SCVirtualNetwork -VMHost $VMHost
The first command gets the host object named VMHost01 and stores the object in the $VMHost variable.
The second command gets all virtual network objects on VMHost01 and displays information about each virtual network.
Example 3: Get a virtual network by name from a specific host
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost02.Contoso.com"
PS C:\> $VN = Get-SCVirtualNetwork -VMHost $VMHost -Name "InternalVNet01"
PS C:\> $VN
The first command gets the host object named VMHost02 and stores the object in the $VMHost variable.
The second command gets the virtual network object named InternalVNet01 from VMHost02 and stores the object in the $VN variable.
The last command displays information about the virtual network stored in $VN to the user.
Parameters
-ID
Specifies the numerical identifier as a globally unique identifier, or GUID, for a specific object.
Parameter properties
Type: | Guid |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
ByID
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Name
Specifies the name of a VMM object.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 0 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-VMHost
Specifies a virtual machine host object. VMM supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts.
For more information about each type of host, see the Add-SCVMHost cmdlet.
Parameter properties
Type: | Host |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
FilterByVMHost
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-VMHostCluster
Specifies a VMM host cluster object.
Parameter properties
Type: | HostCluster |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Cluster
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-VMMServer
Specifies a VMM server object.
Parameter properties
Type: | ServerConnection |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
NoFilter
Position: | Named |
Mandatory: | False |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Outputs
VirtualNetwork
This cmdlet returns a VirtualNetwork object.