Edit

Share via


Remove-CMUserCollectionIncludeMembershipRule

Remove an include membership rule from a user collection.

Syntax

ByNameAndName (Default)

Remove-CMUserCollectionIncludeMembershipRule
    -CollectionName <String>
    -IncludeCollectionName <String>
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByNameAndValue

Remove-CMUserCollectionIncludeMembershipRule
    -CollectionName <String>
    -IncludeCollection <IResultObject>
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByNameAndId

Remove-CMUserCollectionIncludeMembershipRule
    -CollectionName <String>
    -IncludeCollectionId <String>
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByIdAndValue

Remove-CMUserCollectionIncludeMembershipRule
    -CollectionId <String>
    -IncludeCollection <IResultObject>
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByIdAndId

Remove-CMUserCollectionIncludeMembershipRule
    -CollectionId <String>
    -IncludeCollectionId <String>
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByIdAndName

Remove-CMUserCollectionIncludeMembershipRule
    -CollectionId <String>
    -IncludeCollectionName <String>
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByValueAndValue

Remove-CMUserCollectionIncludeMembershipRule
    -InputObject <IResultObject>
    -IncludeCollection <IResultObject>
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByValueAndId

Remove-CMUserCollectionIncludeMembershipRule
    -InputObject <IResultObject>
    -IncludeCollectionId <String>
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByValueAndName

Remove-CMUserCollectionIncludeMembershipRule
    -InputObject <IResultObject>
    -IncludeCollectionName <String>
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Use this cmdlet to remove an include membership rule from a user collection. An include membership rule includes the members of another collection in the user collections where the rule is applied.

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

When you remove an include membership rule to a collection, a resource may no longer be a member of the user collection. This action can cause any software or configuration deployment to not apply to a user.

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 include membership rule

This command removes the include membership rule for the All Users collection from the user collection named Users. Specifying the Force parameter indicates that the membership rule is removed without prompting you.

Remove-CMUserCollectionIncludeMembershipRule -CollectionName "Users" -IncludeCollectionName "All Users" -Force

Parameters

-CollectionId

Specify the ID of the user collection to remove the rule. This value is the CollectionID property, for example, XYZ00012. Since default collections don't have include 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 remove 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

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Run the command without asking for confirmation.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IncludeCollection

Specify an object for the included collection to remove 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

-IncludeCollectionId

Specify the ID of the included collection to remove the rule. This value is the CollectionID property, for example, XYZ00012. You can include 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

-IncludeCollectionName

Specify the name of the included collection to remove the rule.

Parameter properties

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

Parameter sets

ByNameAndName
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
ByValueAndName
Position:Named
Mandatory:True
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 remove 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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
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