external help file | Module Name | ms.date | schema | title |
---|---|---|---|---|
AdminUI.PS.psm1-help.xml |
ConfigurationManager |
12/28/2021 |
2.0.0 |
Add-CMDeviceCollectionExcludeMembershipRule |
Add an exclude membership rule to a device collection.
Add-CMDeviceCollectionExcludeMembershipRule -CollectionName <String> -ExcludeCollectionName <String>
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Add-CMDeviceCollectionExcludeMembershipRule -CollectionName <String> -ExcludeCollection <IResultObject>
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Add-CMDeviceCollectionExcludeMembershipRule -CollectionName <String> -ExcludeCollectionId <String> [-PassThru]
[-WhatIf] [-Confirm] [<CommonParameters>]
Add-CMDeviceCollectionExcludeMembershipRule -CollectionId <String> -ExcludeCollection <IResultObject>
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Add-CMDeviceCollectionExcludeMembershipRule -CollectionId <String> -ExcludeCollectionId <String> [-PassThru]
[-WhatIf] [-Confirm] [<CommonParameters>]
Add-CMDeviceCollectionExcludeMembershipRule -CollectionId <String> -ExcludeCollectionName <String> [-PassThru]
[-WhatIf] [-Confirm] [<CommonParameters>]
Add-CMDeviceCollectionExcludeMembershipRule -InputObject <IResultObject> -ExcludeCollection <IResultObject>
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Add-CMDeviceCollectionExcludeMembershipRule -InputObject <IResultObject> -ExcludeCollectionId <String>
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Add-CMDeviceCollectionExcludeMembershipRule -InputObject <IResultObject> -ExcludeCollectionName <String>
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Use this cmdlet to add an exclude membership rule to a device collection. An exclude membership rule excludes the members of another collection from the device collections where the rule is applied.
You can't add membership rules to default collections. Any collection that you target should have an ID that starts with the site code, not SMS
. You can exclude a default collection, so the ID of an excluded collection can start with SMS
.
Configuration Manager dynamically updates the membership of the device collection on a schedule if the membership of the excluded collection changes.
When you add an exclude membership rule to a collection, a resource may no longer be a member of the device collection. This action can cause any software or configuration deployment to not apply to a device.
For more information, see How to create collections in Configuration Manager.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
This command excludes the members of the All Mobile Devices default collection, which has the ID SMSDM001, from the device collection ID XYZ00012.
Add-CMDeviceCollectionExcludeMembershipRule -CollectionId "XYZ00012" -ExcludeCollectionId "SMSDM001"
Specify the ID of the device collection to add the rule. This value is the CollectionID property, for example, XYZ00012
. Since default collections don't have exclude membership rules, this ID starts with the site code and not SMS
.
Type: String
Parameter Sets: ByIdAndValue, ByIdAndId, ByIdAndName
Aliases: Id
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify the name of the device collection to add the rule.
Type: String
Parameter Sets: ByNameAndName, ByNameAndValue, ByNameAndId
Aliases: Name
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify an object for the excluded collection to add the rule. To get this object, use the Get-CMCollection or Get-CMDeviceCollection cmdlets.
Type: IResultObject
Parameter Sets: ByNameAndValue, ByIdAndValue, ByValueAndValue
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify the ID of the excluded collection to add the rule. This value is the CollectionID property, for example, XYZ00012
. You can exclude default collections, so this value can start with either the site code or SMS
.
Type: String
Parameter Sets: ByNameAndId, ByIdAndId, ByValueAndId
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify the name of the excluded collection to add the rule.
Type: String
Parameter Sets: ByNameAndName, ByIdAndName, ByValueAndName
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify an object for the device collection to add the rule. To get this object, use the Get-CMCollection or Get-CMDeviceCollection cmdlets.
Type: IResultObject
Parameter Sets: ByValueAndValue, ByValueAndId, ByValueAndName
Aliases: Collection
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Add this parameter to return an object that represents the item with which you're working. By default, this cmdlet may not generate any output.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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
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
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Get-CMDeviceCollectionExcludeMembershipRule Remove-CMDeviceCollectionExcludeMembershipRule
Get-CMCollection Get-CMDeviceCollection