Edit

Share via


Get-CMCollection

Get a device or user collection object.

Syntax

ByName (Default)

Get-CMCollection
    [-CollectionType <CollectionType>]
    [-Name <String>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

ByDPGroup

Get-CMCollection
    -DistributionPointGroup <IResultObject>
    [-CollectionType <CollectionType>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

ByDPGroupId

Get-CMCollection
    -DistributionPointGroupId <String>
    [-CollectionType <CollectionType>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

ByDPGroupName

Get-CMCollection
    -DistributionPointGroupName <String>
    [-CollectionType <CollectionType>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

ById

Get-CMCollection
    -Id <String>
    [-CollectionType <CollectionType>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

Description

Use this cmdlet to get a device or user collection object.

Collections help you organize resources into manageable units. You can create collections to match your client management needs, and to perform operations on multiple resources at one time. Most management tasks rely on or require using one or more collections.

To scope the type of collection that you get, use the Get-CMDeviceCollection or Get-CMUserCollection cmdlets.

If you don't specify a collection by name, ID or object, this cmdlet returns all collections.

For more information, see Introduction to collections in Configuration Manager.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Get a collection by name

This command gets the collection named testUser.

Get-CMCollection -Name "testUser"

Example 2: Get a collection for a distribution point group

This command gets the distribution point group object named dpg1 and uses the pipeline operator to pass the object to Get-CMCollection, which gets the collections associated with the distribution point group.

Get-CMDistributionPointGroup -Name "dpg1" | Get-CMCollection

When you distribute content to these collections, the site automatically distributes to all current members of this distribution point group. For more information, see Manage distribution point groups.

Parameters

-CollectionType

Filter the type of collection to get. This parameter is functionally the same as using the Get-CMDeviceCollection or Get-CMUserCollection cmdlets.

Parameter properties

Type:CollectionType
Default value:None
Accepted values:User, Device
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DistributionPointGroup

Specify a distribution point group object that's associated with this collection. To get this object, use the Get-CMDistributionPointGroup cmdlet.

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByDPGroup
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-DistributionPointGroupId

Specify the GUID for a distribution point group that's associated with this collection. This value is the GroupID property, which is a standard GUID surrounded by curly brackets, for example, {537e6303-69eb-4104-bf7b-7baf43ce2352}.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByDPGroupId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DistributionPointGroupName

Specify the name of a distribution point group that's associated with this collection.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByDPGroupName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

Specify the ID of the collection to get. This value is the CollectionID property, for example, XYZ00012 or SMS00001.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:CollectionId

Parameter sets

ById
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specify the name of the collection to get.

Parameter properties

Type:String
Default value:None
Supports wildcards:True
DontShow:False

Parameter sets

ByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

IResultObject

IResultObject

Notes

For more information on this return object and its properties, see SMS_Collection server WMI class.