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

Gets the query membership rules from one or more user collections in the Configuration Manager hierarchy.

Syntax

Get-CMUserCollectionQueryMembershipRule
   -CollectionId <String>
   [-RuleName <String>]
   [<CommonParameters>]
Get-CMUserCollectionQueryMembershipRule
   -CollectionName <String>
   [-RuleName <String>]
   [<CommonParameters>]
Get-CMUserCollectionQueryMembershipRule
   -InputObject <IResultObject>
   [-RuleName <String>]
   [<CommonParameters>]

Description

The Get-CMUserCollectionQueryMembershipRule cmdlet retrieves rules from the specified user collections. You can specify the user collections where the rule is applied by using their names, IDs, or by specifying an input object that represents the user collections. The query is specified by its ID or name.

A query rule lets you dynamically update the membership of a collection based on a query that is run on a schedule. For more information about membership rules in Microsoft System Center Configuration Manager, see Introduction to Collections in Configuration Manager on TechNet.

Examples

Example 1: Get a rule by using a collection name

PS C:\> Get-CMUserCollectionQueryMembershipRule -CollectionName "Remote Users" -RuleName "Remote Users by Domain"

This command gets the rule named Remote Users by Domain that belongs to the collection named Remote Users.

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

Optional Parameters

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