Add-CMUserCollectionExcludeMembershipRule

Adds an exclude membership rule to one or more Configuration Manager user collections.

Syntax

Add-CMUserCollectionExcludeMembershipRule
   -CollectionId <String>
   [-Confirm]
   -ExcludeCollection <IResultObject>
   [-PassThru]
   [-WhatIf]
   [<CommonParameters>]
Add-CMUserCollectionExcludeMembershipRule -CollectionId  [-Confirm] -ExcludeCollectionId 
 [-PassThru] [-WhatIf] []
Add-CMUserCollectionExcludeMembershipRule -CollectionId  [-Confirm] -ExcludeCollectionName 
 [-PassThru] [-WhatIf] []
Add-CMUserCollectionExcludeMembershipRule -CollectionName  [-Confirm] -ExcludeCollectionName 
 [-PassThru] [-WhatIf] []
Add-CMUserCollectionExcludeMembershipRule -CollectionName  [-Confirm]
 -ExcludeCollection  [-PassThru] [-WhatIf] []
Add-CMUserCollectionExcludeMembershipRule -CollectionName  [-Confirm] -ExcludeCollectionId 
 [-PassThru] [-WhatIf] []
Add-CMUserCollectionExcludeMembershipRule [-Confirm] -ExcludeCollection 
 -InputObject  [-PassThru] [-WhatIf] []
Add-CMUserCollectionExcludeMembershipRule [-Confirm] -ExcludeCollectionId  -InputObject 
 [-PassThru] [-WhatIf] []
Add-CMUserCollectionExcludeMembershipRule [-Confirm] -ExcludeCollectionName 
 -InputObject  [-PassThru] [-WhatIf] []

Description

The Add-CMUserCollectionExcludeMembershipRule cmdlet adds a rule that excludes the members of another collection from the user collections where the rule is applied. You can specify the user collections where the rule is applied by using their names, IDs, or by specifying an object that represents the collections. You can specify the collection whose members are excluded by using its name, ID, or an object that represents the collection.

Microsoft System Center Configuration Manager dynamically updates the membership of the user collection on a schedule if the membership of the excluded collection changes. For more information on these rules, see Introduction to Collections in Configuration Manager on TechNet.

Examples

Example 1: Add an exclude membership rule to a user collection

PS C:\>Add-CMUserCollectionExcludeMembershipRule -CollectionId "9990000D" -ExcludeCollectionId "SMSDM001"

This command adds an exclude membership rule that has the ID SMSDM001 to the Configuration Manager user collection that has the ID 9990000D.

Required Parameters

-CollectionId
Type:String
Aliases:Id
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CollectionName
Type:String
Aliases:Name
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ExcludeCollection
Type:IResultObject
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ExcludeCollectionId
Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ExcludeCollectionName
Type:String
Required:True
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
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False