Get-CMDeviceCollectionIncludeMembershipRule
Get an include membership rule for a device collection.
Syntax
Get-CMDeviceCollectionIncludeMembershipRule
-CollectionName <String>
[-IncludeCollectionName <String>]
[<CommonParameters>]
Get-CMDeviceCollectionIncludeMembershipRule
-CollectionName <String>
-IncludeCollection <IResultObject>
[<CommonParameters>]
Get-CMDeviceCollectionIncludeMembershipRule
-CollectionName <String>
-IncludeCollectionId <String>
[<CommonParameters>]
Get-CMDeviceCollectionIncludeMembershipRule
-CollectionId <String>
-IncludeCollection <IResultObject>
[<CommonParameters>]
Get-CMDeviceCollectionIncludeMembershipRule
-CollectionId <String>
-IncludeCollectionId <String>
[<CommonParameters>]
Get-CMDeviceCollectionIncludeMembershipRule
-CollectionId <String>
[-IncludeCollectionName <String>]
[<CommonParameters>]
Get-CMDeviceCollectionIncludeMembershipRule
-InputObject <IResultObject>
-IncludeCollection <IResultObject>
[<CommonParameters>]
Get-CMDeviceCollectionIncludeMembershipRule
-InputObject <IResultObject>
-IncludeCollectionId <String>
[<CommonParameters>]
Get-CMDeviceCollectionIncludeMembershipRule
-InputObject <IResultObject>
[-IncludeCollectionName <String>]
[<CommonParameters>]
Description
Use this cmdlet to get one or more include membership rules for a device collection. An include membership rule includes the members of another collection to the device collections where the rule is applied.
Configuration Manager dynamically updates the membership of the device collection on a schedule if the membership of the included collection changes.
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.
Examples
Example 1: Get all include membership rules
This command gets all include membership rules for the collection named Device.
Get-CMDeviceCollectionIncludeMembershipRule -CollectionName "Device"
Example 2: Get include membership rules by using the pipeline
This command first uses the Get-CMCollection to get the device collection object named Device. It then uses the pipeline operator to pass the object to the Get-CMDeviceCollectionIncludeMembershipRule cmdlet, which gets all include membership rules for the device collection object.
Get-CMCollection -Name "Device" | Get-CMDeviceCollectionIncludeMembershipRule
Parameters
-CollectionId
Specify the ID of the device collection to get the rule. This value is the CollectionID property, for example, XYZ00012
. Since default collections don't have include membership rules, this ID starts with the site code and not SMS
.
Type: | String |
Aliases: | Id |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CollectionName
Specify the name of the device collection to get the rule.
Type: | String |
Aliases: | Name |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IncludeCollection
Specify an object for the included collection to get the rule. To get this object, use the Get-CMCollection or Get-CMDeviceCollection cmdlets.
Type: | IResultObject |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IncludeCollectionId
Specify the ID of the included collection to get the rule. This value is the CollectionID property, for example, XYZ00012
. You can include default collections, so this value can start with either the site code or SMS
.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IncludeCollectionName
Specify the name of the included collection to get the rule.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Specify an object for the device collection to get the rule. To get this object, use the Get-CMCollection or Get-CMDeviceCollection cmdlets.
Type: | IResultObject |
Aliases: | Collection |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
Microsoft.ConfigurationManagement.ManagementProvider.IResultObject
Outputs
System.Object