Get-CMCollection

Gets a collection.

Syntax

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

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
Required:True
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
Required:True
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
Required:True
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
Required:True
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
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

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

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
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
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

IResultObject[]#SMS_Collection