Share via


Set-SCVirtualNetwork

Set-SCVirtualNetwork

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

Syntax

Parameter Set: Host
Set-SCVirtualNetwork [-VirtualNetwork] <VirtualNetwork> [-BoundToVMHost <Boolean]> ] [-Description <String> ] [-HostBoundVLanId <UInt16]> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-Name <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]

Parameter Set: Cluster
Set-SCVirtualNetwork [-ClusterVirtualNetwork] <ClusterVirtualNetwork> [-BoundToVMHost <Boolean]> ] [-Description <String> ] [-HostBoundVLanId <UInt16]> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-Name <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]

Parameter Set: LogicalSwitch
Set-SCVirtualNetwork [-VirtualNetwork] <VirtualNetwork> -LogicalSwitch <LogicalSwitch> [-Description <String> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-VMHostNetworkAdapters <HostNetworkAdapter[]> ] [ <CommonParameters>]

Detailed 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.

Parameters

-BoundToVMHost<Boolean]>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ClusterVirtualNetwork<ClusterVirtualNetwork>

Specifies a cluster virtual network object.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Description<String>

States a description for the specified object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-HostBoundVLanId<UInt16]>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobGroup<Guid]>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobVariable<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LogicalSwitch<LogicalSwitch>

Specifies a logical switch object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of a VMM object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid]>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

Aliases

none

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VirtualNetwork<VirtualNetwork>

Specifies a virtual network object.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VMHostNetworkAdapters<HostNetworkAdapter[]>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • VirtualNetwork

Examples

Example 1: Unbind a virtual network from a host

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

The second command gets the virtual network object named InternalVNet01 from VMHost01, and then 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.

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

Add-SCVMHostNetworkAdapter

Get-SCVirtualNetwork

Get-SCVirtualNetworkAdapter

Get-SCVMHost

Get-SCVMHostNetworkAdapter

New-SCVirtualNetwork

Remove-SCVirtualNetwork

Set-SCVirtualNetworkAdapter

Set-SCVMHostNetworkAdapter