external help file | Module Name | ms.date | schema | title |
---|---|---|---|---|
AdminUI.PS.psm1-help.xml |
ConfigurationManager |
12/29/2021 |
2.0.0 |
New-CMDeviceCollection |
Create a device collection.
New-CMDeviceCollection [-Comment <String>] -LimitingCollectionName <String> -Name <String>
[-RefreshSchedule <IResultObject>] [-RefreshType <CollectionRefreshType>] [-WhatIf] [-Confirm]
[<CommonParameters>]
New-CMDeviceCollection [-Comment <String>] -InputObject <IResultObject> -Name <String>
[-RefreshSchedule <IResultObject>] [-RefreshType <CollectionRefreshType>] [-WhatIf] [-Confirm]
[<CommonParameters>]
New-CMDeviceCollection [-Comment <String>] -LimitingCollectionId <String> -Name <String>
[-RefreshSchedule <IResultObject>] [-RefreshType <CollectionRefreshType>] [-WhatIf] [-Confirm]
[<CommonParameters>]
Use this cmdlet to create a device collection based on a specific limiting collection. The limiting collection determines which devices can be a member of the device collection that you create. For instance, when you use the All Systems collection as the limiting collection, the new collection can include any device in the Configuration Manager hierarchy.
You can then add devices to the collection with membership rules. To add members to the device collection, use one of the following membership rule cmdlets:
- Add-CMDeviceCollectionDirectMembershipRule
- Add-CMDeviceCollectionExcludeMembershipRule
- Add-CMDeviceCollectionIncludeMembershipRule
- Add-CMDeviceCollectionQueryMembershipRule
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 creates a collection for all computers that run Windows 11. The LimitingCollectionName parameter specifies that any device in the All Systems collection can be a member of the new collection.
New-CMDeviceCollection -Name "Windows 11" -LimitingCollectionName "All Systems"
Specify an optional comment to describe and identify this collection.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify an object for the limiting collection. To get this object, use the Get-CMCollection or Get-CMDeviceCollection cmdlets.
Type: IResultObject
Parameter Sets: ByValue
Aliases: LimitingCollection
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Specify the ID of the limiting collection. This value is the CollectionID property, for example, XYZ00012
or SMS00001
.
Type: String
Parameter Sets: ById
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify the name of the limiting collection.
Type: String
Parameter Sets: ByName
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify the name for the new device collection.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
If you set the RefreshType parameter to either Periodic
or Both
, use this parameter to set the schedule. Specify a schedule object for when the site runs a full update of the collection membership. To get this object, use the New-CMSchedule cmdlet.
Type: IResultObject
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify how the collection membership is updated:
Manual
(1): An administrator manually triggers a membership update in the Configuration Manager console or with the Invoke-CMCollectionUpdate cmdlet.Periodic
(2): The site does a full update on a schedule. It doesn't use incremental updates. If you don't specify a type, this value is the default.Continuous
(4): The site periodically evaluates new resources and then adds new members. This type is also known as an incremental update. It doesn't do a full update on a schedule.Both
(6): A combination of bothPeriodic
andContinuous
, with both incremental updates and a full update on a schedule.
If you specify either Periodic
or Both
, use the RefreshSchedule parameter to set the schedule.
Note
The None
value (0) is functionally the same as Manual
.
Type: CollectionRefreshType
Parameter Sets: (All)
Aliases:
Accepted values: None, Manual, Periodic, Continuous, Both
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.