Share via


New-CMDeviceCollection

New-CMDeviceCollection

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

Syntax

Parameter Set: NewByLimitName
New-CMDeviceCollection -LimitingCollectionName <String> -Name <String> [-Comment <String> ] [-RefreshSchedule <IResultObject> ] [-RefreshType <RefreshTypes> {Both | ConstantUpdate | Manual | Periodic} ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: NewByLimitId
New-CMDeviceCollection -LimitingCollectionId <String> -Name <String> [-Comment <String> ] [-RefreshSchedule <IResultObject> ] [-RefreshType <RefreshTypes> {Both | ConstantUpdate | Manual | Periodic} ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed 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

-- Add-CMDeviceCollectionExcludeMembershipRule

-- Add-CMDeviceCollectionIncludeMembershipRule

-- Add-CMDeviceCollectionQueryMembershipRule

Collections represent logical groupings of resources, such as users and devices. For more information about Configuration Manager collections, see Introduction to Collections in Configuration Manager (https://go.microsoft.com/fwlink/p/?LinkID=259433) on TechNet.

Parameters

-Comment<String>

Specifies a description of the collection, such as what type of devices are included in the collection.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-LimitingCollectionId<String>

Specifies the ID of the collection that Configuration Manager uses to limit which devices are available to the collection that you are creating. For example, the following ID is the ID of the All Systems collection: SMS00001.

Aliases

LimitToCollectionId

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-LimitingCollectionName<String>

Specifies the name of the collection that Configuration Manager uses to limit which devices are available to the collection that you are creating. For example, you can specify the All Systems collection.

Aliases

LimitToCollectionName

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies the name for the collection that you want to create. The collection name might reflect an organization or what type of devices are in the collection. For example, you could create a Windows 7 collection to contain all devices running Windows 7.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-RefreshSchedule<IResultObject>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-RefreshType<RefreshTypes>

Specifies how Configuration Manager refreshes the collection. The acceptable values for this parameter are:

-- Manual. The collection is refreshed using the Configuration Manager console or the Configuration Manager SDK.
-- Periodic. The collection is refreshed based on the schedule specified by the RefreshSchedule parameter.
-- ConstantUpdate. The collection is refreshed whenever a member is added to the collection.

Aliases

none

Required?

false

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: Create a device collection

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.

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

Export-CMDeviceCollection

Get-CMDeviceCollection

Import-CMDeviceCollection

Remove-CMDeviceCollection

Set-CMDeviceCollection

Introduction to Collections in Configuration Manager