Add-CMDeviceCollectionIncludeMembershipRule

Adds an Include Collections membership rule to a device collection.

Syntax

Add-CMDeviceCollectionIncludeMembershipRule
   -CollectionId <String>
   [-Confirm]
   -IncludeCollection <IResultObject>
   [-PassThru]
   [-WhatIf]
   [<CommonParameters>]
Add-CMDeviceCollectionIncludeMembershipRule -CollectionId  [-Confirm] -IncludeCollectionId 
 [-PassThru] [-WhatIf] []
Add-CMDeviceCollectionIncludeMembershipRule -CollectionId  [-Confirm] -IncludeCollectionName 
 [-PassThru] [-WhatIf] []
Add-CMDeviceCollectionIncludeMembershipRule -CollectionName  [-Confirm] -IncludeCollectionName 
 [-PassThru] [-WhatIf] []
Add-CMDeviceCollectionIncludeMembershipRule -CollectionName  [-Confirm]
 -IncludeCollection  [-PassThru] [-WhatIf] []
Add-CMDeviceCollectionIncludeMembershipRule -CollectionName  [-Confirm] -IncludeCollectionId 
 [-PassThru] [-WhatIf] []
Add-CMDeviceCollectionIncludeMembershipRule [-Confirm] -IncludeCollection 
 -InputObject  [-PassThru] [-WhatIf] []
Add-CMDeviceCollectionIncludeMembershipRule [-Confirm] -IncludeCollectionId 
 -InputObject  [-PassThru] [-WhatIf] []
Add-CMDeviceCollectionIncludeMembershipRule [-Confirm] -IncludeCollectionName 
 -InputObject  [-PassThru] [-WhatIf] []

Description

The Add-CMDeviceCollectionIncludeMembershipRule cmdlet adds an Include Collections membership rule to a device collection. An Include Collections membership rule includes members of other device collections in the device collection where the rule is applied.

Examples

Example 1: Add an Include Collections membership rule

PS C:\>Add-CMDeviceCollectionIncludeMembershipRule -CollectionName "Device" -IncludeCollectionName "All Systems"

This command adds the device collection named All Systems as an Include Collections membership rule associated with the device collection named Device.

Example 2: Add an Include Membership rule to a collection by using the pipeline

PS C:\> Get-CMCollection -Name "Device" | Add-CMDeviceCollectionIncludeMembershipRule -IncludeCollectionName "All Systems"

This command gets the collection object named Device and uses the pipeline operator to pass the object to Add-CMDeviceCollectionIncludeMembershipRule. Add-CMDeviceCollectionIncludeMembershipRule adds the device collection named All Systems as an Include Collections membership rule associated with the device collection object.

Required Parameters

-CollectionId

Specifies the ID of a device collection.

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

Specifies the name of a device collection.

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

Specifies a device collection object to include in the membership rule. To obtain a collection object, use the Get-CMCollection cmdlet.

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

Specifies the ID of a device collection to include in the membership rule.

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

Specifies the name of a device collection to include in the membership rule.

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