Remove-SCVirtualNetwork

Removes a virtual network from a host managed by VMM.

Syntax

Remove-SCVirtualNetwork [-ClusterVirtualNetwork] <ClusterVirtualNetwork> [-Confirm] [-JobGroup <Guid>]
 [-JobVariable <String>] [-PROTipID <Guid>] [-RunAsynchronously] [-WhatIf] [<CommonParameters>]
Remove-SCVirtualNetwork [-VirtualNetwork] <VirtualNetwork> [-Confirm] [-JobGroup <Guid>]
 [-JobVariable <String>] [-PROTipID <Guid>] [-RunAsynchronously] [-WhatIf] [<CommonParameters>]

Description

The Remove-SCVirtualNetwork cmdlet removes one or more virtual network objects from Virtual Machine Manager (VMM).

This cmdlet returns the object upon success (with the property MarkedForDeletion set to True) or returns an error message upon failure.

Examples

Example 1: Remove a specific virtual network from a host

PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com" 
PS C:\> $Network = Get-SCVirtualNetwork -VMHost $VMHost -Name "InternalVNet01"
PS C:\> Remove-SCVirtualNetwork -VirtualNetwork $Network -Confirm

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 configured on VMHost01 and stores the object in the $Network variable.

The last command removes InternalVNet01 from VMHost01, prompting you for confirmation before continuing the action.

Parameters

-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
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value: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
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
-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
-VirtualNetwork

Specifies a virtual network object.

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

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False