Add-CMDeviceCollectionIncludeMembershipRule

Adds an Include Collections membership rule to a device collection.

Syntax

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

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
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
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
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
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
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
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
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-PassThru

Returns the current working object. By default, this cmdlet does not generate any output.

Type:SwitchParameter
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
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False