Set-SCVirtualNetwork

Changes the properties of a virtual network configured on a host managed by VMM.

Syntax

Set-SCVirtualNetwork [-BoundToVMHost <Boolean>] [-Description <String>] [-HostBoundVLanId <UInt16>]
 [-JobGroup <Guid>] [-JobVariable <String>] [-Name <String>] [-PROTipID <Guid>] [-RunAsynchronously]
 -VirtualNetwork <VirtualNetwork> [<CommonParameters>]
Set-SCVirtualNetwork [-ClusterVirtualNetwork] <ClusterVirtualNetwork> [-BoundToVMHost <Boolean>]
 [-Description <String>] [-HostBoundVLanId <UInt16>] [-JobGroup <Guid>] [-JobVariable <String>]
 [-Name <String>] [-PROTipID <Guid>] [-RunAsynchronously] [<CommonParameters>]
Set-SCVirtualNetwork [-ConvertToLogicalSwitch] [-Description <String>] [-JobGroup <Guid>]
 [-JobVariable <String>] -LogicalSwitch <LogicalSwitch> [-PROTipID <Guid>] [-RunAsynchronously]
 -VirtualNetwork <VirtualNetwork> [<CommonParameters>]
Set-SCVirtualNetwork [-Description <String>] [-JobGroup <Guid>] [-JobVariable <String>]
 -LogicalSwitch <LogicalSwitch> [-PROTipID <Guid>] [-RunAsynchronously]
 [-VMHostNetworkAdapters <HostNetworkAdapter[]>] -VirtualNetwork <VirtualNetwork> [<CommonParameters>]

Description

The Set-SCVirtualNetwork cmdlet changes the properties of a virtual network configured on a host managed by Virtual Machine Manager (VMM).

Virtual network properties that you can change include:

- Any Host. For a virtual network configured for virtual machines deployed on any host supported by VMM (a Hyper-V, VMware ESX, or Citrix XenServer host), you can set or modify the name or description.

- Hyper-V Host Only. If the host is a Hyper-V host, you can also configure whether virtual machines are bound to the host (and can thus access the host operating system), and you can specify a numerical identifier for a virtual local area network (VLAN) on the host.

Examples

Example 1: Unbind a virtual network from a host

PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com" 
PS C:\> $VirtualNetwork = Get-SCVirtualNetwork -VMHost $VMHost -Name "InternalVNet01"
PS C:\> Set-SCVirtualNetwork -VirtualNetwork $VirtualNetwork -Name "UnboundVNet01" -BoundToVMHost $False

The first command gets the host object named VMHost01 and stores the object in the $VMHost variable.

The second command gets the virtual network object named InternalVNet01 from VMHost01 and stores the object in the $VirtualNetwork variable.

The last command renames the virtual network to UnboundVNet01 and sets VMHostBound to $False. This unbinds the virtual network from the host, which prevents any virtual machines that are attached to this virtual network from accessing the host through this network.

Parameters

-BoundToVMHost

Indicates whether a virtual network is bound to a host. Binding a virtual network to a host enables network communication to the host.

Type:Boolean
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ClusterVirtualNetwork

Specifies a cluster virtual network object.

Type:ClusterVirtualNetwork
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ConvertToLogicalSwitch

Indicates that this cmdlet converts the virtual network to a logical switch.

Type:SwitchParameter
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Description

Specifies a description for the virtual network.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-HostBoundVLanId

Assigns a VLAN to the virtual network adapter that was created for the host for the specified virtual network.

Type:UInt16
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-JobGroup

Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.

Type:Guid
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-LogicalSwitch

Specifies a logical switch object.

Type:LogicalSwitch
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of a VMM object.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VMHostNetworkAdapters

Specifies an array of one or more physical network adapter objects on a host to which virtual machines deployed on that host can connect.

Example format: -VMHostNetworkAdapters $VMHostNICs

Type:HostNetworkAdapter[]
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VirtualNetwork

Specifies a virtual network object.

Type:VirtualNetwork
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Outputs

VirtualNetwork

This cmdlet returns a **VirtualNetwork** object.