Set-CMCollection

Sets a collection.

Syntax

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

Description

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

Examples

Example 1: Get a collection and modify it

PS C:\> $userCollection = Get-CMCollection -Name "testUser"
PS C:\> 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 C:\> 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.

Required Parameters

-CollectionId

Specifies a collection ID.

Type:String
Required:True
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
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of a collection.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Comment

Specifies a comment for the collection.

Type:String
Required:False
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
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

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

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
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
Required:False
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
Required:False
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
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NewName

Specifies a new name for the collection.

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

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Type:SwitchParameter
Required:False
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
Required:False
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
Parameter Sets:None, Manual, Periodic, Continuous, Both
Required:False
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
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False