Get-CMUserCollectionDirectMembershipRule

Get-CMUserCollectionDirectMembershipRule

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

Syntax

Parameter Set: ByCollectionNameAndResourceName
Get-CMUserCollectionDirectMembershipRule -CollectionName <String> -ResourceName <String> [ <CommonParameters>]

Parameter Set: ByCollectionIdAndResourceId
Get-CMUserCollectionDirectMembershipRule -CollectionId <String> -ResourceId <Int32> [ <CommonParameters>]

Parameter Set: ByCollectionIdAndResourceName
Get-CMUserCollectionDirectMembershipRule -CollectionId <String> -ResourceName <String> [ <CommonParameters>]

Parameter Set: ByCollectionNameAndResourceId
Get-CMUserCollectionDirectMembershipRule -CollectionName <String> -ResourceId <Int32> [ <CommonParameters>]

Parameter Set: ByCollectionValueAndResourceId
Get-CMUserCollectionDirectMembershipRule -Collection <IResultObject> -ResourceId <Int32> [ <CommonParameters>]

Parameter Set: ByCollectionValueAndResourceName
Get-CMUserCollectionDirectMembershipRule -Collection <IResultObject> -ResourceName <String> [ <CommonParameters>]

Detailed 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 (https://go.microsoft.com/fwlink/p/?LinkID=259433) in the TechNet library.

Parameters

-Collection<IResultObject>

Specifies a Configuration Manager user collection object. To obtain a user collection object, use the Get-CMUserCollection cmdlet.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CollectionId<String>

Specifies the ID of a user collection.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CollectionName<String>

Specifies the name of a user collection.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ResourceId<Int32>

Specifies the ID of the rule that you want to retrieve.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ResourceName<String>

Specifies the name of the rule that you want to retrieve.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Get a direct membership rule

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

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

Get-CMUserCollection

Add-CMUserCollectionDirectMembershipRule

Remove-CMUserCollectionDirectMembershipRule