Поделиться через


Remove-SCVMHostCluster

Removes a host cluster object from VMM.

Syntax

NormalRemoval (Default)

Remove-SCVMHostCluster
    [-VMHostCluster] <HostCluster>
    [-Credential <VMMCredential>]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ForceRemoval

Remove-SCVMHostCluster
    [-VMHostCluster] <HostCluster>
    [-Force]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-SCVMHostCluster cmdlet removes one or more host cluster objects from Virtual Machine Manager (VMM).

Remove-SCVMHostCluster does not destroy the cluster. To uncluster a host cluster by using VMM, use the Uninstall-SCVMHostCluster cmdlet.

Examples

Example 1: Remove a specific host cluster from VMM

PS C:\> $Credential = Get-SCRunAsAccount -Name "RunAsAccount01"
PS C:\> $Cluster = Get-SCVMHostCluster -Name "VMHostCluster01.Contoso.com"
PS C:\> Remove-SCVMHostCluster -VMHostCluster $Cluster -Credential $Credential -Confirm

The first command gets the Run As account object named RunAsAccount01 and stores the object in the $Credential variable. The Run As account used for this operation must be a domain account with administrator rights on all of the nodes of the failover cluster that you want to remove.

The second command gets the failover cluster object named VMHostCluster01 and stores the object in the $VMHostCluster variable.

The last command removes the VMHostCluster01 cluster object from the VMM database and stops managing that host cluster, after prompting the user for confirmation. It does not modify the host cluster settings or its existing virtual machines. As this command is processed, $Credential provides the stored Run As account to Remove-SCVMHostCluster.

Example 2: Remove all host clusters from VMM

PS C:\> $Credential = Get-SCRunAsAccount -Name "RunAsAccount01"
PS C:\> Get-SCVMHostCluster | Remove-SCVMHostCluster -Credential $Credential -Confirm

The first command gets the Run As account object named RunAsAccount01 and stores the object in the $Credential variable. The Run As account used for this operation must be a domain account with administrator rights on all of the nodes of the failover cluster that you want to remove.

The second command gets all host cluster objects and passes the objects to the Remove-SCVMHostCluster cmdlet, which removes each host cluster object from VMM and stops managing the corresponding host cluster, after prompting the user for confirmation. The command does not modify the host cluster settings or its existing virtual machines. As this command is processed, $Credential provides the stored Run As account to Remove-SCVMHostCluster.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Credential

Specifies a credential object or, for some cmdlets, a Run As account object that contains the user name and password of an account that has permission to perform this action. Or, in the case of Restart-SCJob, has permission to complete a restarted task.

For more information about the PSCredential object, type Get-Help Get-Credential. For more information about Run As accounts, type Get-Help New-SCRunAsAccount.

Parameter properties

Type:VMMCredential
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NormalRemoval
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ForceRemoval
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-JobVariable

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RunAsynchronously

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
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

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
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.