Edit

Share via


New-CMOrchestrationGroup

Create a new orchestration group.

Syntax

Default (Default)

New-CMOrchestrationGroup
    [-Name] <String>
    -SiteCode <String>
    [-Description <String>]
    -OrchestrationType <OrchestrationTypeValue>
    [-OrchestrationValue <Int32>]
    [-OrchestrationTimeOutMin <Int32>]
    [-MaxLockTimeOutMin <Int32>]
    [-PreScript <String>]
    [-PreScriptTimeoutSec <Int32>]
    [-PostScript <String>]
    [-PostScriptTimeoutSec <Int32>]
    -MemberResourceIds <Int32[]>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Use this cmdlet to create a new orchestration group.

Use orchestration groups to better control the deployment of software updates to devices. You may need to carefully manage updates for specific workloads, or automate behaviors in between. For more information, see Create and use orchestration groups in Configuration Manager.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1

This example first splats the cmdlet parameters into the parameters variable. It's not required to splat the parameters, it just makes it easier to read the parameters for such a long command line.

It assumes that you have objects for the devices to add to the orchestration group in the device variables.

The command creates an orchestration group with the default settings and simple scripts for testing purposes.

$parameters = @{
  Name = "IT servers"
  SiteCode = "XYZ"
  Description = "An OG for IT servers with default settings"
  OrchestrationType = "Number"
  OrchestrationValue = 1
  OrchestrationTimeOutMin = 720
  MaxLockTimeOutMin = 60
  PreScript = "Write-Host 'Pre-install script'"
  PreScriptTimeoutSec = 120
  PostScript = "Write-Host 'POST-install script'"
  PostScriptTimeoutSec = 120
  MemberResourceIds = $device1.ResourceID, $device2.ResourceID
}

New-CMOrchestrationGroup @parameters

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
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

-Description

Specify an optional description for the orchestration group to help identify it.

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

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

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

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

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

-MaxLockTimeOutMin

Specify an integer value for the orchestration group member timeout in minutes. This value is the time limit for a single device in the group to install the updates.

Parameter properties

Type:Int32
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

-MemberResourceIds

Specify an array of resource IDs for the devices to add as members of this orchestration group. The resource ID is an integer, for example, 16777220. It's the ResourceId property on a device or resource object. To get a device object, use the Get-CMDevice or Get-CMResource cmdlets.

When you set the OrchestrationType parameter to Sequence, use this parameter to determine the order.

Parameter properties

Type:

Int32[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:MogMembers

Parameter sets

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

-Name

Specify a name for the orchestration group.

Parameter properties

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

Parameter sets

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

-OrchestrationTimeOutMin

Specify an integer value for the orchestration group timeout in minutes. This value is the time limit for all group members to install the updates.

Parameter properties

Type:Int32
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

-OrchestrationType

Specify one of the following values for the type of orchestration group:

  • Number: Allow a number of the devices to update at the same time. Use this setting to always limit to a specific number of devices, whatever the overall size of the orchestration group. To specify the number of devices, use the OrchestrationValue parameter.

  • Percentage: Allow a percentage of the devices to update at the same time. Use this setting to allow for future flexibility of the size of the orchestration group. To specify the percentage, use the OrchestrationValue parameter.

  • Sequence: Explicitly define the order in which devices run the software update deployment. The order is determined by the sort of the device resource IDs in the MemberResourceIds parameter.

Parameter properties

Type:OrchestrationTypeValue
Default value:None
Accepted values:Number, Percentage, Sequence
Supports wildcards:False
DontShow:False

Parameter sets

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

-OrchestrationValue

Specify an integer for the number or percentage of devices to update at the same time. Use this parameter when you set the OrchestrationType parameter to Number or Percentage.

Parameter properties

Type:Int32
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

-PostScript

Specify the PowerShell script to run on each device after the deployment runs and the device restarts, if required.

This string value is the text of the script itself. If you have a script in a file that you want to use, first read it into a variable. For example, use the built-in Get-Content cmdlet.

The scripts should return a value of 0 for success. Any non-zero value is considered a script failure. You can't use a script with parameters. The maximum script length is 50,000 characters.

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

-PostScriptTimeoutSec

Specify the integer value for the allowed time in seconds for the post-script to run before it times out.

Parameter properties

Type:Int32
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

-PreScript

Specify the PowerShell script to run on each device before the deployment runs.

This string value is the text of the script itself. If you have a script in a file that you want to use, first read it into a variable. For example, use the built-in Get-Content cmdlet.

The scripts should return a value of 0 for success. Any non-zero value is considered a script failure. You can't use a script with parameters. The maximum script length is 50,000 characters.

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

-PreScriptTimeoutSec

Specify the integer value for the allowed time in seconds for the pre-script to run before it times out.

Parameter properties

Type:Int32
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

-SiteCode

Specify the site code for this orchestration group and its members.

Parameter properties

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

Parameter sets

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

Parameter properties

Type:SwitchParameter
Default value:None
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.

Inputs

None

Outputs

IResultObject

Notes

This cmdlet returns an object for the SMS_MachineOrchestrationGroup WMI class.