New-CMSettingDeployment
Deploy a settings policy object to a collection.
Syntax
New-CMSettingDeployment
[-CMSetting] <CMSettings>
[-Schedule <IResultObject>]
[-OverrideServiceWindows]
[-Collection <IResultObject>]
[-CollectionId <String>]
[-CollectionName <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
Description
Deploy a settings policy object to a collection. For example, deploy a BitLocker management policy or a Microsoft Defender Application Control policy. To create a custom schedule, use the New-CMSchedule cmdlet. To get a collection, use the Get-CMCollection cmdlet.
Examples
Example 1: Deploy a BitLocker management object to all desktop and server clients
This example gets a BitLocker management settings object by name and stores that object in the $setting variable. It then gets a collection by name, and stores that object in the $collection variable. It uses the New-CMSettingDeployment cmdlet to deploy the BitLocker management settings object to that collection.
$setting = Get-CMBlmSetting -Name "My BitLocker settings"
$collection = Get-CMCollection -Name "All Desktop and Server Clients"
New-CMSettingDeployment -CMSetting $setting -CollectionName $collection.Name
Example 2: Deploy a Windows Defender Application Control setting using a custom schedule
This example also creates a custom schedule using the New-CMSchedule cmdlet.
$setting = Get-CMWdacSetting -Name "My App Control settings"
$collection = Get-CMCollection -Name "All Desktop and Server Clients"
$sched = New-CMSchedule -Start ((Get-Date).AddDays(-30)).ToString() -RecurCount 7 -RecurInterval Minutes
$dep = New-CMSettingDeployment -CMSetting $setting -Collection $collection -Schedule $sched
Parameters
-CMSetting
Specify a settings object to deploy.
- For BitLocker management, use the Get-CMBlmSetting or New-CMBlmSetting cmdlets.
- For Microsoft Defender Application Control, use the Get-CMWdacSetting or New-CMWdacSetting cmdlets.
Type: | CMSettings |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Collection
Specify a collection object as the target for the deployment. To get a collection, use the Get-CMCollection cmdlet.
Type: | IResultObject |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CollectionId
Specify the ID of the collection as the target for the deployment.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CollectionName
Specify the name of the collection as the target for the deployment.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | True |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OverrideServiceWindows
When you add this parameter, the client can remediate the settings outside of a maintenance window.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Schedule
Specify a schedule object to apply to the deployment. To create a custom schedule, use the New-CMSchedule cmdlet.
Type: | IResultObject |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.ConfigurationManagement.PowerShell.Cmdlets.EP.SimplifiedSettings.CMSettings
Outputs
Microsoft.ConfigurationManagement.PowerShell.Cmdlets.Deployments.SettingsDeployment.SettingsDeployment