Edit

Share via


Get-CMUserCollectionExcludeMembershipRule

Get an exclude membership rule for a user collection.

Syntax

ByNameAndName (Default)

Get-CMUserCollectionExcludeMembershipRule
    -CollectionName <String>
    [-ExcludeCollectionName <String>]
    [<CommonParameters>]

ByNameAndValue

Get-CMUserCollectionExcludeMembershipRule
    -CollectionName <String>
    -ExcludeCollection <IResultObject>
    [<CommonParameters>]

ByNameAndId

Get-CMUserCollectionExcludeMembershipRule
    -CollectionName <String>
    -ExcludeCollectionId <String>
    [<CommonParameters>]

ByIdAndValue

Get-CMUserCollectionExcludeMembershipRule
    -CollectionId <String>
    -ExcludeCollection <IResultObject>
    [<CommonParameters>]

ByIdAndId

Get-CMUserCollectionExcludeMembershipRule
    -CollectionId <String>
    -ExcludeCollectionId <String>
    [<CommonParameters>]

ByIdAndName

Get-CMUserCollectionExcludeMembershipRule
    -CollectionId <String>
    [-ExcludeCollectionName <String>]
    [<CommonParameters>]

ByValueAndValue

Get-CMUserCollectionExcludeMembershipRule
    -InputObject <IResultObject>
    -ExcludeCollection <IResultObject>
    [<CommonParameters>]

ByValueAndId

Get-CMUserCollectionExcludeMembershipRule
    -InputObject <IResultObject>
    -ExcludeCollectionId <String>
    [<CommonParameters>]

ByValueAndName

Get-CMUserCollectionExcludeMembershipRule
    -InputObject <IResultObject>
    [-ExcludeCollectionName <String>]
    [<CommonParameters>]

Description

Use this cmdlet to get one or more exclude membership rules for a user collection. An exclude membership rule excludes the members of another collection from the user collections where the rule is applied.

Configuration Manager dynamically updates the membership of the user collection on a schedule if the membership of the excluded collection changes.

For more information, see How to create collections in Configuration Manager.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Get the exclude membership rules for a user collection

This command gets the rules that exclude the members of the collection with ID XYZ00089 from the user collection with ID XYZ00012.

Get-CMUserCollectionExcludeMembershipRule -CollectionId "XYZ00012" -ExcludeCollectionId "XYZ00089"

Parameters

-CollectionId

Specify the ID of the user collection to get the rule. This value is the CollectionID property, for example, XYZ00012. Since default collections don't have exclude membership rules, this ID starts with the site code and not SMS.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Id

Parameter sets

ByIdAndValue
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByIdAndId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByIdAndName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CollectionName

Specify the name of the user collection to get the rule.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Name

Parameter sets

ByNameAndName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByNameAndValue
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByNameAndId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExcludeCollection

Specify an object for the excluded collection to get the rule. To get this object, use the Get-CMCollection or Get-CMUserCollection cmdlets.

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByNameAndValue
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByIdAndValue
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByValueAndValue
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExcludeCollectionId

Specify the ID of the excluded collection to get the rule. This value is the CollectionID property, for example, XYZ00012. You can exclude default collections, so this value can start with either the site code or SMS.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByNameAndId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByIdAndId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByValueAndId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExcludeCollectionName

Specify the name of the excluded collection to get the rule.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByNameAndName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByIdAndName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ByValueAndName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Specify an object for the user collection to get the rule. To get this object, use the Get-CMCollection or Get-CMUserCollection cmdlets.

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Collection

Parameter sets

ByValueAndValue
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
ByValueAndId
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False
ByValueAndName
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object