New-CMUserCollection

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

Syntax

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

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 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-CMDeviceCollectionQueryMembershipRule
  • Add-CMUserCollectionDirectMembershipRule
  • Add-CMUserCollectionExcludeMembershipRule
  • Add-CMUserCollectionIncludeMembershipRule

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 on TechNet.

Examples

Example 1: Create a user collection

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

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.

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

Optional Parameters

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