Remove-SCVMHostGroup

Removes a host group from VMM.

Description

The Remove-SCVMHostGroup cmdlet removes one or more host group objects from the System Center Virtual Machine Manager (VMM) database. A host group cannot be deleted if it is associated with a private cloud, if it has hosts assigned to it, or if its child host group has hosts assigned to it. This cmdlet will delete child host groups if the host group and its child host groups do not contain any virtual machine hosts. 

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

For more information about Remove-SCVMHostGroup, type: "Get-Help Remove-SCVMHostGroup -online".

Parameters

VMHostGroup

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a virtual machine host group object.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 
Requires a VMM host group object, which can be retrieved by using the Get-SCVMHostGroup cmdlet.

Examples

1: Remove the specified host group.
PS C:\> $HostGroup = Get-SCVMHostGroup -Name "HostGroup02"
PS C:\> Remove-SCVMHostGroup -VMHostGroup $HostGroup
The first command gets the host group named HostGroup02 and stores it in the $HostGroup variable. 

The second command removes the host group object stored in the $HostGroup variable. 

See Also