Get-CMDeviceCollectionDirectMembershipRule

Gets a direct membership rule for a device collection.

Syntax

Get-CMDeviceCollectionDirectMembershipRule
   -CollectionId <String>
   -Resource <IResultObject>
   [<CommonParameters>]
Get-CMDeviceCollectionDirectMembershipRule
   -CollectionId <String>
   -ResourceId <String>
   [<CommonParameters>]
Get-CMDeviceCollectionDirectMembershipRule
   -CollectionId <String>
   [-ResourceName <String>]
   [<CommonParameters>]
Get-CMDeviceCollectionDirectMembershipRule
   -CollectionName <String>
   [-ResourceName <String>]
   [<CommonParameters>]
Get-CMDeviceCollectionDirectMembershipRule
   -CollectionName <String>
   -Resource <IResultObject>
   [<CommonParameters>]
Get-CMDeviceCollectionDirectMembershipRule
   -CollectionName <String>
   -ResourceId <String>
   [<CommonParameters>]
Get-CMDeviceCollectionDirectMembershipRule
   -InputObject <IResultObject>
   -Resource <IResultObject>
   [<CommonParameters>]
Get-CMDeviceCollectionDirectMembershipRule
   -InputObject <IResultObject>
   -ResourceId <String>
   [<CommonParameters>]
Get-CMDeviceCollectionDirectMembershipRule
   -InputObject <IResultObject>
   [-ResourceName <String>]
   [<CommonParameters>]

Description

The Get-CMDeviceCollectionDirectMembershipRule cmdlet gets one or more direct membership rules for a device collection.

Examples

Example 1: Get a direct membership rule by its name

PS C:\> Get-CMDeviceCollectionDirectMembershipRule -CollectionName "Device01"

This command gets the direct membership rules for the device collection named Device01.

Example 2: Get a direct membership rule by using the pipeline

PS C:\> Get-CMCollection -Name "Device02" | Get-CMDeviceCollectionDirectMembershipRule

This command gets the device collection object named Device02 and uses the pipeline operator to pass the object to Get-CMDeviceCollectionDirectMembershipRule which gets the direct membership rules for the device collection object.

Required Parameters

-CollectionId

Specifies the ID of a device collection.

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

Specifies the name of a device collection.

Type:String
Aliases:Name
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies the input to this cmdlet. You can use this parameter, or you can pipe the input to this cmdlet.

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

Specifies a resource object. To obtain a resource object, use the Get-CMResource cmdlet.

Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceId

Specifies the ID of a resource.

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

Optional Parameters

-ResourceName

Specifies the name of a resource.

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