Add-CMUserCollectionDirectMembershipRule

Adds a direct membership rule to one or more Configuration Manager user collections.

Syntax

Add-CMUserCollectionDirectMembershipRule
   -CollectionId <String>
   [-Confirm]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-PassThru]
   -ResourceId <Int32>
   [-WhatIf]
   [<CommonParameters>]
Add-CMUserCollectionDirectMembershipRule -CollectionId  [-Confirm] [-DisableWildcardHandling]
 [-ForceWildcardHandling] [-PassThru] -Resource  [-WhatIf] []
Add-CMUserCollectionDirectMembershipRule -CollectionName  [-Confirm] [-DisableWildcardHandling]
 [-ForceWildcardHandling] [-PassThru] -Resource  [-WhatIf] []
Add-CMUserCollectionDirectMembershipRule -CollectionName  [-Confirm] [-DisableWildcardHandling]
 [-ForceWildcardHandling] [-PassThru] -ResourceId  [-WhatIf] []
Add-CMUserCollectionDirectMembershipRule [-Confirm] [-DisableWildcardHandling] [-ForceWildcardHandling]
 -InputObject  [-PassThru] -Resource  [-WhatIf] []
Add-CMUserCollectionDirectMembershipRule [-Confirm] [-DisableWildcardHandling] [-ForceWildcardHandling]
 -InputObject  [-PassThru] -ResourceId  [-WhatIf] []

Description

The Add-CMUserCollectionDirectMembershipRule cmdlet adds a rule that adds a specific resource to the user collections. You can specify the user collections by using their names, IDs, or by specifying an object that represents the collections.

A direct rule lets you explicitly choose the members of the user collection. For more information on collection rules in Microsoft System Center Configuration Manager, see Introduction to Collections in Configuration Manager on TechNet.

Examples

Example 1: Add a direct membership rule to a user collection

PS C:\>Add-CMUserCollectionDirectMembershipRule -CollectionName "All Mobile Devices" -ResourceId "Res_94412512"

This command adds a direct membership rule that has the ID Res_94412512 to the Configuration Manager user collection named All Mobile Devices.

Required Parameters

-CollectionId

Specifies the ID of the user collection where the rule is applied.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CollectionName

Specifies the name of a user collection where the rule is applied.

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
-Resource

Specifies the type of the resource that the cmdlet adds to the user collections.

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

Specifies the ID of a resource that the cmdlet adds to the user collections.

Type:Int32
Required:True
Position:Named
Default value:None
Accept pipeline input:False
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
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

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

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
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