Skip to content

Latest commit

 

History

History
196 lines (140 loc) · 5.09 KB

Remove-CMUserCollectionQueryMembershipRule.md

File metadata and controls

196 lines (140 loc) · 5.09 KB
external help file Module Name ms.date schema title
AdminUI.PS.psm1-help.xml
ConfigurationManager
12/30/2021
2.0.0
Remove-CMUserCollectionQueryMembershipRule

Remove-CMUserCollectionQueryMembershipRule

SYNOPSIS

Remove a query membership rule from a user collection.

SYNTAX

ByValue (Default)

Remove-CMUserCollectionQueryMembershipRule -InputObject <IResultObject> -RuleName <String> [-Force] [-WhatIf]
 [-Confirm] [<CommonParameters>]

ByName

Remove-CMUserCollectionQueryMembershipRule -CollectionName <String> -RuleName <String> [-Force] [-WhatIf]
 [-Confirm] [<CommonParameters>]

ById

Remove-CMUserCollectionQueryMembershipRule -CollectionId <String> -RuleName <String> [-Force] [-WhatIf]
 [-Confirm] [<CommonParameters>]

DESCRIPTION

Use this cmdlet to remove a query membership rule from a user collection. A query rule lets you dynamically update the membership of a collection based on a query that is run on a schedule. You can't remove query rules from the default collections. Any collection that you target should have an ID that starts with the site code, not SMS. For more information, see How to create collections in Configuration Manager.

When you remove a query membership rule from a collection, multiple resources may no longer be members of the collection. This action can cause any software or configuration deployment to not apply to the users.

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 a rule from a collection by using the collection name

This command removes the rule named Remote Users by Domain from the collection named Remote Users.

Remove-CMUserCollectionQueryMembershipRule -CollectionName "Remote Users" -RuleName "Remote Users by Domain"

PARAMETERS

-CollectionId

Specify the ID of the user collection to remove the rule. This value is the CollectionID property, for example, XYZ00012. Since you can't remove the query rules from default collections, this ID starts with the site code and not SMS.

Type: String
Parameter Sets: ById
Aliases: Id

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-CollectionName

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

Type: String
Parameter Sets: ByName
Aliases: Name

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Force

Run the command without asking for confirmation.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-InputObject

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

Type: IResultObject
Parameter Sets: ByValue
Aliases: Collection

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-RuleName

Specify the name of the query rule to remove from the collection.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

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

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

OUTPUTS

System.Object

NOTES

RELATED LINKS

Add-CMUserCollectionQueryMembershipRule Get-CMUserCollectionQueryMembershipRule

Remove-CMCollectionQueryMembershipRule

Get-CMCollection Get-CMUserCollection

Remove-CMDeviceCollectionQueryMembershipRule

How to create collections in Configuration Manager