Set-CMDeviceCollectionVariable

Set-CMDeviceCollectionVariable

Sets the properties of a task sequence variable of a device collection in the Configuration Manager hierarchy.

Syntax

Parameter Set: SetByNameMandatory
Set-CMDeviceCollectionVariable -CollectionName <String> -VariableName <String> [-IsMask <Boolean> ] [-NewVariableName <String> ] [-NewVariableValue <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetByIdMandatory
Set-CMDeviceCollectionVariable -CollectionId <String> -VariableName <String> [-IsMask <Boolean> ] [-NewVariableName <String> ] [-NewVariableValue <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetByValueMandatory
Set-CMDeviceCollectionVariable -Collection <IResultObject> -VariableName <String> [-IsMask <Boolean> ] [-NewVariableName <String> ] [-NewVariableValue <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Set-CMDeviceCollectionVariable cmdlet updates the name and value of a task sequence variable.

Task sequence variables are a set of name and value pairs that provide a mechanism to configure and customize the steps of a task sequence when the task sequence is deployed to a specific collection. For more information about task sequence variables in Microsoft System Center 2012 SP1 Configuration Manager, see Planning a Task Sequence Strategy in Configuration Manager (https://go.microsoft.com/fwlink/p/?LinkID=260806) on TechNet.

Parameters

-Collection<IResultObject>

Specifies an object that represents the device collection. To obtain a device collection object, use the Get-CMDeviceCollectionVariable cmdlet.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CollectionId<String>

Specifies the ID of a device collection.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CollectionName<String>

Specifies the name of the device collection.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-IsMask<Boolean>

Indicates whether a value displays in the Configuration Manager console.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-NewVariableName<String>

Specifies a name for the variable.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-NewVariableValue<String>

Specifies a value for the variable.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-VariableName<String>

Specifies the name of the variable that this cmdlet updates.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Set a task sequence variable for a device collection

This command sets the task sequence variable named New_ComputerName for the device collection named All Unknown Devices.

PS C:\> Set-CMDeviceCollectionVariable -CollectionName "All Unknown Devices" -VariableName "New_ComputerName"

Get-CMDeviceCollectionVariable

New-CMDeviceCollectionVariable

Remove-CMDeviceCollectionVariable

Get-CMDeviceCollection

Planning a Task Sequence Strategy in Configuration Manager