Get-​CM​Collection

Gets a collection.

Syntax

Get-CMCollection
   [-CollectionType <CollectionType>]
   [-DisableWildcardHandling]
   -DistributionPointGroup <IResultObject>
   [-ForceWildcardHandling]
   [<CommonParameters>]
Get-CMCollection
   [-CollectionType <CollectionType>]
   [-DisableWildcardHandling]
   -DistributionPointGroupId <String>
   [-ForceWildcardHandling]
   [<CommonParameters>]
Get-CMCollection
   [-CollectionType <CollectionType>]
   [-DisableWildcardHandling]
   -DistributionPointGroupName <String>
   [-ForceWildcardHandling]
   [<CommonParameters>]
Get-CMCollection
   [-CollectionType <CollectionType>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   -Id <String>
   [<CommonParameters>]
Get-CMCollection
   [-CollectionType <CollectionType>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-Name <String>]
   [<CommonParameters>]

Description

The Get-CMCollection cmdlet gets a Microsoft System Center Configuration Manager collection.

Examples

Example 1: Get a collection by name

PS C:\> Get-CMCollection -Name "testUser"

This command gets the collection named testUser.

Example 2: Get a collection for a distribution point group

PS C:\> Get-CMDistributionPointGroup -Name "testDPGroup" | Get-CMCollection

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

Required Parameters

-DistributionPointGroup

Specifies a distribution point group object that is associated with a collection. To obtain a distribution point group object, use the Get-CMDistributionPointGroup cmdlet.

Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-DistributionPointGroupId

Specifies the ID of the distribution point group that is associated with the collection.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DistributionPointGroupName

Specifies the name of the distribution point group that is associated with a collection.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Id

Specifies a collection ID. If you do not specify a collection, all collections in the hierarchy are returned.

Type:String
Aliases:CollectionId
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-CollectionType

Specifies a type for the collection. Valid values are:- Root

  • User
  • Device
  • Unknown
Type:CollectionType
Parameter Sets:User, Device
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies a collection name. If you do not specify a collection, all collections in the hierarchy are returned.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

IResultObject[]#SMS_Collection