New-CMCollection

Creates a collection.

Syntax

New-CMCollection
   -CollectionType <CollectionType>
   [-Comment <String>]
   -InputObject <IResultObject>
   -Name <String>
   [-RefreshSchedule <IResultObject>]
   [-RefreshType <CollectionRefreshType>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMCollection
   -CollectionType <CollectionType>
   [-Comment <String>]
   -LimitingCollectionId <String>
   -Name <String>
   [-RefreshSchedule <IResultObject>]
   [-RefreshType <CollectionRefreshType>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMCollection
   -CollectionType <CollectionType>
   [-Comment <String>]
   -LimitingCollectionName <String>
   -Name <String>
   [-RefreshSchedule <IResultObject>]
   [-RefreshType <CollectionRefreshType>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-CMCollection cmdlet creates a collection in Microsoft System Center Configuration Manager.

Examples

Example 1: Create a collection and specify its scope

PS C:\> New-CMCollection -CollectionType User -LimitingCollectionName "All Users" -Name "testUser"

This command creates a user collection named testUser that establishes the All Users collection as the scope from which you can add members.

Example 2: Create a collection based on an existing one

PS C:\> Get-CMCollection -Name "All Users" | New-CMCollection -Name "testUser" -CollectionType "User"

This command gets the collection object named All Users and uses the pipeline operator to pass the object to New-CMCollection. New-CMCollection creates a collection named testUser that is based on the membership of the All Users collection.

Required Parameters

-CollectionType

Specifies a type for the collection. Valid values are:

  • Root
  • User
  • Device
  • Unknown
Type:CollectionType
Parameter Sets:User, Device
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

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

Type:IResultObject
Aliases:LimitingCollection
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
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 a name for the collection.

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

Optional Parameters

-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
-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
Parameter Sets:None, Manual, Periodic, Continuous, Both
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

Outputs

IResultObject#SMS_Collection