Remove-CMDeviceCollectionIncludeMembershipRule

Removes an Include Collections membership rule from a device collection.

Syntax

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

Description

The Remove-CMDeviceCollectionIncludeMembershipRule cmdlet removes an Include Collections membership rule from a device collection.

Examples

Example 1: Remove an Include Collections membership rule

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

This command removes the Include Collections membership rule named All Systems from the device collection named Device. Specifying the Force parameter indicates that the membership rule is removed without prompting the user.

Example 2: Remove an include membership rule by using the pipeline

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

This command gets the device collection object named Device and uses the pipeline operator to pass the object to Remove-CMDeviceCollectionIncludeMembershipRule. Remove-CMDeviceCollectionIncludeMembershipRule removes the Include Collections membership rule named All Systems from the device collection object. Specifying the Force parameter indicates that the membership rule is removed without prompting the user.

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 included in a 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 included in a 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 included in a 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
-Force

Forces the command to run without asking for user confirmation.

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