New-CMUserCollection

New-CMUserCollection

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

Syntax

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

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

Detailed Description

The New-CMUserCollection cmdlet creates a collection based on a specific limiting collection. The limiting collection determines which users can be a member of the user collection that you create. For example, when you use the All Users collection as the limiting collection, the new collection can include any user in the Microsoft System Center 2012 Configuration Manager hierarchy. You specify the limiting collection by providing its name or ID.

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

-- Add-CMUserCollectionDirectMembershipRule
-- Add-CMUserCollectionExcludeMembershipRule
-- Add-CMUserCollectionIncludeMembershipRule
-- 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) in the TechNet library.

Parameters

-Comment<String>

Specifies a description of the collection, such as the users in a specific organization.

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 limiting collection that Configuration Manager uses to limit which users are available to the user collection that you are creating. For example, the following ID is the ID of the All Users collection: SMS00002.

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 limiting collection that Configuration Manager uses to limit which users are available to the user collection that you are creating. For example, you can specify the All Users 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 user collection that you want to create.

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. Valid values 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.
-- CONSTANT_UPDATE. 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 user collection

This command creates a collection for all users in the Sales department. Specifying All Users for the LimitingCollectionName parameter indicates that the new collection can include any user in the Configuration Manager hierarchy.

PS C:\> New-CMUserCollection –Name "Sales" –LimitingCollectionName "All Users"

Get-CMUserCollection

Set-CMUserCollection

Remove-CMUserCollection

Import-CMUserCollection

Export-CMUserCollection