New-CMBaselineDeployment
Create a baseline deployment.
Syntax
New-CMBaselineDeployment
[-EnableEnforcement <Boolean>]
[-GenerateAlert <Boolean>]
[-InputObject] <IResultObject>
[-MonitoredByScom <Boolean>]
[-OverrideServiceWindow <Boolean>]
[-ParameterValue <Int32>]
[-PostponeDateTime <DateTime>]
[-Schedule <IResultObject>]
[-Collection <IResultObject>]
[-CollectionId <String>]
[-CollectionName <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-CMBaselineDeployment
[-EnableEnforcement <Boolean>]
[-GenerateAlert <Boolean>]
[-Id] <Int32>
[-MonitoredByScom <Boolean>]
[-OverrideServiceWindow <Boolean>]
[-ParameterValue <Int32>]
[-PostponeDateTime <DateTime>]
[-Schedule <IResultObject>]
[-Collection <IResultObject>]
[-CollectionId <String>]
[-CollectionName <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-CMBaselineDeployment
[-EnableEnforcement <Boolean>]
[-GenerateAlert <Boolean>]
[-MonitoredByScom <Boolean>]
[-Name] <String>
[-OverrideServiceWindow <Boolean>]
[-ParameterValue <Int32>]
[-PostponeDateTime <DateTime>]
[-Schedule <IResultObject>]
[-Collection <IResultObject>]
[-CollectionId <String>]
[-CollectionName <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Deploy a configuration baseline. Use the Get-CMBaseline cmdlet to get a baseline.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
Examples
Example 1: Deploy a baseline to collections with the same named prefix
This example uses Get-CMBaseline to get the configuration baseline and store it into the variable $BaselineName. It then uses Get-CMCollection to get a list of all collections whose name starts with "Collection_Name" and stores them to the variable $DeployToCollections. Next, it creates a schedule for the deployment with the New-CMSchedule cmdlet. Once all of the required information is stored, the example loops through each collection and deploys the baseline using New-CMBaselineDeployment.
$BaselineName = Get-CMBaseline -Name 'ConfigMgr Baseline'
$DeployToCollections = Get-CMCollection -Name 'Collection_Name*' | Sort-Object -Property "Name"
$BaselineSchedule = New-CMSchedule -DurationInterval Days -DurationCount 0 -RecurInterval Days -RecurCount 1
foreach ($Collection in $DeployToCollection)
{
New-CMBaselineDeployment -InputObject $BaselineName -CollectionID $Collection.CollectionId -Schedule $BaselineSchedule
Write-Output "Created Deployment for $($BaselineName.LocalizedDisplayName) on $($Collection.Name)"
}
Example 2: Deploy a baseline to one collection
First, this example creates a simple schedule. It then deploys the baseline MY_Baseline to the collection with ID PS1000023.
$BaselineSchedule = New-CMSchedule -DurationInterval Days -DurationCount 0 -RecurInterval Days -RecurCount 1
New-CMBaselineDeployment -Name "MY_Baseline" -CollectionID "PS1000023" -Schedule $BaselineSchedule
Parameters
-Collection
Specify a collection object as the target of the baseline deployment.
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 of 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 of the deployment.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | True |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-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 |
-EnableEnforcement
If $true
, remediate noncompliant rules when supported.
Type: | Boolean |
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 |
-GenerateAlert
If $true
, generate an alert.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Id
Specify the ID of the configuration baseline to deploy.
Type: | Int32 |
Aliases: | CIId, CI_ID, BaselineId |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Specify a configuration baseline object to deploy. Use the Get-CMBaseline cmdlet to get a baseline.
Type: | IResultObject |
Aliases: | Baseline |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-MonitoredByScom
If $true
, generate a System Center Operations Manager alert.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Specify the name of the configuration baseline to deploy.
Type: | String |
Aliases: | LocalizedDisplayName, BaselineName |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OverrideServiceWindow
If $true
, allow the client to remediate this baseline outside of maintenance windows.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ParameterValue
If you use the -GenerateAlert parameter, specify an integer value as a percentage (0-100). When compliance of this configuration baseline is below this value, the site generates an alert.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PostponeDateTime
This parameter corresponds to the Date and time property of the configuration baseline when you use the -GenerateAlert parameter.
Type: | DateTime |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Schedule
Specify a schedule object for when the client evaluates this configuration baseline. Use the New-CMSchedule cmdlet to create a schedule.
Type: | IResultObject |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet doesn't run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.ConfigurationManagement.ManagementProvider.IResultObject
Outputs
System.Object