Set-SCVirtualNetwork
Changes the properties of a virtual network configured on a host managed by VMM.
Syntax
Set-SCVirtualNetwork
[-VirtualNetwork] <VirtualNetwork>
[-Name <String>]
[-Description <String>]
[-BoundToVMHost <Boolean>]
[-HostBoundVLanId <UInt16>]
[-JobGroup <Guid>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Set-SCVirtualNetwork
[-VirtualNetwork] <VirtualNetwork>
-LogicalSwitch <LogicalSwitch>
[-VMHostNetworkAdapters <HostNetworkAdapter[]>]
[-Description <String>]
[-JobGroup <Guid>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Set-SCVirtualNetwork
[-VirtualNetwork] <VirtualNetwork>
-LogicalSwitch <LogicalSwitch>
[-Description <String>]
[-JobGroup <Guid>]
[-ConvertToLogicalSwitch]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Set-SCVirtualNetwork
[-ClusterVirtualNetwork] <ClusterVirtualNetwork>
[-Name <String>]
[-Description <String>]
[-BoundToVMHost <Boolean>]
[-HostBoundVLanId <UInt16>]
[-JobGroup <Guid>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<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 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ClusterVirtualNetwork
Specifies a cluster virtual network object.
Type: | ClusterVirtualNetwork |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ConvertToLogicalSwitch
Indicates that this cmdlet converts the virtual network to a logical switch.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
Specifies a description for the virtual network.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LogicalSwitch
Specifies a logical switch object.
Type: | LogicalSwitch |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies the name of a VMM object.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VirtualNetwork
Specifies a virtual network object.
Type: | VirtualNetwork |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
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[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Outputs
VirtualNetwork
This cmdlet returns a VirtualNetwork object.