Remove-CMCollectionExcludeMembershipRule
Remove an exclude membership rule from a device or user collection.
Syntax
Remove-CMCollectionExcludeMembershipRule
-CollectionName <String>
-ExcludeCollectionName <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMCollectionExcludeMembershipRule
-CollectionName <String>
-ExcludeCollection <IResultObject>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMCollectionExcludeMembershipRule
-CollectionName <String>
-ExcludeCollectionId <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMCollectionExcludeMembershipRule
-CollectionId <String>
-ExcludeCollection <IResultObject>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMCollectionExcludeMembershipRule
-CollectionId <String>
-ExcludeCollectionId <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMCollectionExcludeMembershipRule
-CollectionId <String>
-ExcludeCollectionName <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMCollectionExcludeMembershipRule
-InputObject <IResultObject>
-ExcludeCollection <IResultObject>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMCollectionExcludeMembershipRule
-InputObject <IResultObject>
-ExcludeCollectionId <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMCollectionExcludeMembershipRule
-InputObject <IResultObject>
-ExcludeCollectionName <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Use this cmdlet to remove an exclude membership rule from a device or user collection. An exclude membership rule excludes the members of another collection from the collections where the rule is applied.
For more information, see How to create collections in Configuration Manager.
When you remove an exclude membership rule from a collection, resources may become members of the collection. This action can cause any software or configuration deployment to apply to resources in the previously excluded collection.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
Examples
Example 1: Remove an exclude membership rule from a device collection
This command removes the rule that excludes collection SMSDM001 from the device collection with ID XYZ00012.
Remove-CMCollectionExcludeMembershipRule -CollectionId "XYZ00012" -ExcludeCollectionId "SMSDM001" -Force
Parameters
-CollectionId
Specify the ID of the collection to remove 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
.
Type: | String |
Aliases: | Id |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CollectionName
Specify the name of the collection to remove the rule.
Type: | String |
Aliases: | Name |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ExcludeCollection
Specify an object for the excluded collection to remove the rule. To get this object, use the Get-CMCollection, Get-CMDeviceCollection, or Get-CMUserCollection cmdlets.
Type: | IResultObject |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ExcludeCollectionId
Specify the ID of the excluded collection to remove 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
.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ExcludeCollectionName
Specify the name of the excluded collection to get the rule.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Force
Run the command without asking for confirmation.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Specify an object for the collection to remove the rule. To get this object, use the Get-CMCollection, Get-CMDeviceCollection, or Get-CMUserCollection cmdlets.
Type: | IResultObject |
Aliases: | Collection |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet doesn't run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.ConfigurationManagement.ManagementProvider.IResultObject
Outputs
System.Object
Notes
This cmdlet is similar to Remove-CMDeviceCollectionExcludeMembershipRule and Remove-CMUserCollectionExcludeMembershipRule, which are specific to the type of collection. This cmdlet works with either device or user collections.
Related Links
- Get-CMCollectionExcludeMembershipRule
- Remove-CMCollectionDirectMembershipRule
- Remove-CMCollectionIncludeMembershipRule
- Remove-CMCollectionQueryMembershipRule
- Add-CMDeviceCollectionExcludeMembershipRule
- Add-CMUserCollectionExcludeMembershipRule
- Get-CMDeviceCollectionExcludeMembershipRule
- Get-CMUserCollectionExcludeMembershipRule
- Get-CMCollection
- Get-CMDeviceCollection
- Get-CMUserCollection
- How to create collections in Configuration Manager