Add-SCCustomPlacementRule

Adds a custom placement rule to the placement configuration for a host group.

Description

The Add-SCCustomPlacementRule adds a custom placement rule to the placement configuration for a host group.

For more information about Add-SCCUstomPlacementRule, type: "Get-Help Add-SCCustomPlacementRule -online".

Parameters

CustomPropertyName

Required? true
Accept Pipeline Input? false
Position? named
Specifies the name for a custom property.

MustMatch

Required? true
Accept Pipeline Input? false
Position? named
Indicates that the property value of the virtual machine must match the host.

PlacementConfiguration

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a placement configuration object.

Confirm

Required? false
Accept Pipeline Input? false
Position? named
Prompts for confirmation before running the command.

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. 

VMMServer

Required? false
Accept Pipeline Input? false
Position? named
Specifies a VMM server object.

CustomPropertyName

Required? true
Accept Pipeline Input? false
Position? named
Specifies the name for a custom property.

MustNotMatch

Required? true
Accept Pipeline Input? false
Position? named
Indicates that the property value of the virtual machine must not match the host.

PlacementConfiguration

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a placement configuration object.

Confirm

Required? false
Accept Pipeline Input? false
Position? named
Prompts for confirmation before running the command.

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. 

VMMServer

Required? false
Accept Pipeline Input? false
Position? named
Specifies a VMM server object.

CustomPropertyName

Required? true
Accept Pipeline Input? false
Position? named
Specifies the name for a custom property.

PlacementConfiguration

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a placement configuration object.

ShouldMatch

Required? true
Accept Pipeline Input? false
Position? named
Indicates that the property value of the virtual machine should match the host.

Confirm

Required? false
Accept Pipeline Input? false
Position? named
Prompts for confirmation before running the command.

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. 

VMMServer

Required? false
Accept Pipeline Input? false
Position? named
Specifies a VMM server object.

CustomPropertyName

Required? true
Accept Pipeline Input? false
Position? named
Specifies the name for a custom property.

PlacementConfiguration

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a placement configuration object.

ShouldNotMatch

Required? true
Accept Pipeline Input? false
Position? named
Indicates that the property value of the virtual machine should not match the host.

Confirm

Required? false
Accept Pipeline Input? false
Position? named
Prompts for confirmation before running the command.

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. 

VMMServer

Required? false
Accept Pipeline Input? false
Position? named
Specifies a VMM server object.

Examples

1: Add a new custom placement rule to a placement configuration for a host group
PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup01"
PS C:\> $PlacementConfig = Get-SCPlacementConfiguration -VMHostGroup $HostGroup
PS C:\> $CustomProp = Get-SCCustomProperty -Name "Cost Center"
PS C:\> Add-SCCustomPlacementRule -PlacementConfiguration $PlacementConfig -MustMatch -CustomProperty $CustomProp
The first command gets the host group object named HostGroup01 and stores the object in the $HostGroup variable.

The second command gets the placement configuration object for the host group stored in $HostGroup and places the object in the $PlacementConfig variable.

The third command gets the custom property object named Cost Center and stores the object in the $CustomProp variable.

The last command adds a custom placement rule to the placement configuration stored in $PlacementConfig.

See Also