New-CMDeviceCollection

Creates a collection for devices and adds the collection to the Configuration Manager hierarchy.

Syntax

New-CMDeviceCollection
   [-Comment <String>]
   [-Confirm]
   -InputObject <IResultObject>
   -Name <String>
   [-RefreshSchedule <IResultObject>]
   [-RefreshType <CollectionRefreshType>]
   [-WhatIf]
   [<CommonParameters>]
New-CMDeviceCollection [-Comment ] [-Confirm] -LimitingCollectionId  -Name 
 [-RefreshSchedule ] [-RefreshType ] [-WhatIf] []
New-CMDeviceCollection [-Comment ] [-Confirm] -LimitingCollectionName  -Name 
 [-RefreshSchedule ] [-RefreshType ] [-WhatIf] []

Description

The New-CMDeviceCollection cmdlet creates a collection based on a specific limiting collection. The limiting collection determines which devices can be a member of the device collection that you create. For instance, when you use the All Systems collection as the limiting collection, the new collection can include any device in the Configuration Manager hierarchy. You specify the limiting collection by providing its name or ID.

Devices are added to the collection by membership rules. To add members to the device collection use one of the following membership rule cmdlets:

- Add-CMDeviceCollectionDirectMembershipRule

Examples

Example 1: Create a device collection

PS C:\> New-CMDeviceCollection -Name "Windows 7" -LimitingCollectionName "All Systems"

This command creates a collection for all computers that run Windows® 7. The LimitingCollectionName parameter specifies that any device in the All Systems collection can be a member of the Windows® 7 collection.

Required Parameters

-InputObject

Specifies the input to this cmdlet. You can use this parameter, or you can pipe the input to this cmdlet.

Type:IResultObject
Aliases:LimitingCollection
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-LimitingCollectionId
Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-LimitingCollectionName
Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name
Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Comment
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
-RefreshSchedule
Type:IResultObject
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RefreshType
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