Set-CMCollection

Sets a Configuration Manager collection.

Syntax

Set-CMCollection
   -InputObject <IResultObject>
   [-NewName <String>]
   [-Comment <String>]
   [-LimitingCollectionId <String>]
   [-LimitingCollectionName <String>]
   [-LimitingCollection <IResultObject>]
   [-RefreshSchedule <IResultObject>]
   [-RefreshType <CollectionRefreshType>]
   [-VariablePriority <Int32>]
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMCollection
   -Name <String>
   [-NewName <String>]
   [-Comment <String>]
   [-LimitingCollectionId <String>]
   [-LimitingCollectionName <String>]
   [-LimitingCollection <IResultObject>]
   [-RefreshSchedule <IResultObject>]
   [-RefreshType <CollectionRefreshType>]
   [-VariablePriority <Int32>]
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMCollection
   -CollectionId <String>
   [-NewName <String>]
   [-Comment <String>]
   [-LimitingCollectionId <String>]
   [-LimitingCollectionName <String>]
   [-LimitingCollection <IResultObject>]
   [-RefreshSchedule <IResultObject>]
   [-RefreshType <CollectionRefreshType>]
   [-VariablePriority <Int32>]
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-CMCollection cmdlet changes settings for a collection in Configuration Manager.

Configuration Manager collections provide a way to manage users, computers, and other resources in your organization. They not only give you a means to organize your resources, but they also give you a means to distribute Configuration Manager packages to clients and users.

Note

Configuration Manager cmdlets must be run from the Configuration Manager site drive. The examples in this article use the site name XYZ. For more information, see the getting started documentation.

Examples

Example 1: Get a collection and modify it

PS XYZ:\> $userCollection = Get-CMCollection -Name "testUser"
PS XYZ:\> Set-CMCollection -CollectionId $userCollection -NewName "newTestUser"

The first command gets the collection object named testUser and stores the object in the $userCollection variable.

The second command updates the name of the collection in $userCollection.

Example 2: Pass a collection and modify it

PS XYZ:\> Get-CMCollection -Name "testUser" | Set-CMCollection -NewName "newTestUser"

This command gets the collection object named testUser and uses the pipeline operator to pass the object to Set-CMCollection, which updates its name to newTestUser.

Parameters

-CollectionId

Specifies a collection ID.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Comment

Specifies a comment for the collection.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies a collection object. To obtain a collection object, use the Get-CMCollection cmdlet.

Type:IResultObject
Aliases:Collection
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-LimitingCollection

Specifies a collection object to use as a scope for this collection. To obtain a collection object, use the Get-CMCollection cmdlet.

Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-LimitingCollectionId

Specifies the ID of a collection to use as a scope for this collection.

Type:String
Aliases:LimitToCollectionId
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-LimitingCollectionName

Specifies the name of a collection to use as a scope for this collection.

Type:String
Aliases:LimitToCollectionName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of a collection.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NewName

Specifies a new name for the collection.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PassThru

Returns the current working object. By default, this cmdlet does not generate any output.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RefreshSchedule

Specifies a schedule that determines when Configuration Manager refreshes the collection.

Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RefreshType

Specifies how Configuration Manager refreshes the collection. Valid values are:

  • None
  • Manual
  • Periodic
  • Continuous
  • Both
Type:CollectionRefreshType
Accepted values:None, Manual, Periodic, Continuous, Both
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VariablePriority

{{ Fill VariablePriority Description }}

Type:Int32
Aliases:DeviceCollectionVariablePrecedence
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object