Get-​CM​User​Collection​Direct​Membership​Rule

Gets the direct membership rules of one or more user collections in the Configuration Manager hierarchy.

Syntax

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

Description

The Get-CMUserCollectionDirectMembershipRule cmdlet retrieves the direct rules of the specified collections. You can specify the user collections by using their names, IDs, or by specifying an object that represents the collections.

A direct rule lets you explicitly choose the members of the user collection. For more information about collection rules, see Introduction to Collections in Configuration Manager on TechNet.

Examples

Example 1: Get a direct membership rule

PS C:\> Get-CMUserCollectionDirectMembershipRule -CollectionName "All Mobile Devices" -ResourceId "Res_94412512"

This command gets the direct membership rule that has the Id Res_94412512 for the collection named All Mobile Devices.

Required Parameters

-CollectionId
Type:String
Aliases:Id
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CollectionName
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
Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceId
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

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