Edit

Share via


Set-CMBaseline

Change the settings of configuration baselines.

Syntax

SetByIdMandatory (Default)

Set-CMBaseline
    -Id <Int32>
    [-AddBaseline <String[]>]
    [-AddCategory <String[]>]
    [-AddOptionalConfigurationItem <String[]>]
    [-AddOSConfigurationItem <String[]>]
    [-AddProhibitedConfigurationItem <String[]>]
    [-AddRequiredConfigurationItem <String[]>]
    [-AddSoftwareUpdate <String[]>]
    [-AllowComanagedClients <Boolean>]
    [-ClearBaseline]
    [-ClearOptionalConfigurationItem]
    [-ClearOSConfigurationItem]
    [-ClearProhibitedConfigurationItem]
    [-ClearRequiredConfigurationItem]
    [-ClearSoftwareUpdate]
    [-Description <String>]
    [-DesiredConfigurationDigestPath <String>]
    [-NewName <String>]
    [-PassThru]
    [-RemoveBaseline <String[]>]
    [-RemoveCategory <String[]>]
    [-RemoveOptionalConfigurationItem <String[]>]
    [-RemoveOSConfigurationItem <String[]>]
    [-RemoveProhibitedConfigurationItem <String[]>]
    [-RemoveRequiredConfigurationItem <String[]>]
    [-RemoveSoftwareUpdate <String[]>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SetByNameMandatory

Set-CMBaseline
    -Name <String>
    [-AddBaseline <String[]>]
    [-AddCategory <String[]>]
    [-AddOptionalConfigurationItem <String[]>]
    [-AddOSConfigurationItem <String[]>]
    [-AddProhibitedConfigurationItem <String[]>]
    [-AddRequiredConfigurationItem <String[]>]
    [-AddSoftwareUpdate <String[]>]
    [-AllowComanagedClients <Boolean>]
    [-ClearBaseline]
    [-ClearOptionalConfigurationItem]
    [-ClearOSConfigurationItem]
    [-ClearProhibitedConfigurationItem]
    [-ClearRequiredConfigurationItem]
    [-ClearSoftwareUpdate]
    [-Description <String>]
    [-DesiredConfigurationDigestPath <String>]
    [-NewName <String>]
    [-PassThru]
    [-RemoveBaseline <String[]>]
    [-RemoveCategory <String[]>]
    [-RemoveOptionalConfigurationItem <String[]>]
    [-RemoveOSConfigurationItem <String[]>]
    [-RemoveProhibitedConfigurationItem <String[]>]
    [-RemoveRequiredConfigurationItem <String[]>]
    [-RemoveSoftwareUpdate <String[]>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SetByValueMandatory

Set-CMBaseline
    -InputObject <IResultObject>
    [-AddBaseline <String[]>]
    [-AddCategory <String[]>]
    [-AddOptionalConfigurationItem <String[]>]
    [-AddOSConfigurationItem <String[]>]
    [-AddProhibitedConfigurationItem <String[]>]
    [-AddRequiredConfigurationItem <String[]>]
    [-AddSoftwareUpdate <String[]>]
    [-AllowComanagedClients <Boolean>]
    [-ClearBaseline]
    [-ClearOptionalConfigurationItem]
    [-ClearOSConfigurationItem]
    [-ClearProhibitedConfigurationItem]
    [-ClearRequiredConfigurationItem]
    [-ClearSoftwareUpdate]
    [-Description <String>]
    [-DesiredConfigurationDigestPath <String>]
    [-NewName <String>]
    [-PassThru]
    [-RemoveBaseline <String[]>]
    [-RemoveCategory <String[]>]
    [-RemoveOptionalConfigurationItem <String[]>]
    [-RemoveOSConfigurationItem <String[]>]
    [-RemoveProhibitedConfigurationItem <String[]>]
    [-RemoveRequiredConfigurationItem <String[]>]
    [-RemoveSoftwareUpdate <String[]>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Use this cmdlet to change the settings of a configuration baseline in Configuration Manager. A configuration baseline can include the following types of configuration data:

  • Configuration items
  • Other configuration baselines
  • Software updates

The Configuration Manager client evaluates its compliance against this baseline. If all of the specified items are compliant, then the baseline itself is assessed as compliant. You can also include optional items, which are only evaluated if the relevant application or setting exists on the device.

For more information, see Create configuration baselines 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: Configure a configuration baseline

This example first uses the Get-CMConfigurationItem cmdlet to get a series of configuration items (CIs).

It then splats the cmdlet parameters into the parameters variable. It's not required to splat the parameters, it just makes it easier to read the parameters for such a long command line.

The last command configures the PSTestBaseLine baseline with a new name and description, removes a category, and adds the CIs.

$objPSTestWinAppCI = Get-CMConfigurationItem -Name PSTestWinAppCI
$objPSTestWinAppCI2 = Get-CMConfigurationItem -Name PSTestWinAppCI2
$objPSTestWinOSCI = Get-CMConfigurationItem -Name PSTestWinOSCI
$objPSTestWinAppCI3 = Get-CMConfigurationItem -Name PSTestWinAppCI3
$objPSTestWinAppCI4 = Get-CMConfigurationItem -Name PSTestWinAppCI4
$objPSTestMDCI = Get-CMConfigurationItem -Name PSTestMDCI
$objPSTestMacCI = Get-CMConfigurationItem -Name PSTestMacCI

$parameters = @{
  Name = "PSTestBaseLine"
  NewName = "PSTestBaseLineNew"
  Description = "DCM Testing New"
  RemoveCategory = ("IT Infrastructure")
  AddRequiredConfigurationItems = ($objPSTestWinAppCI4.CI_ID,$objPSTestMDCI.CI_ID)
  AddProhibitedConfigurationItems = ($objPSTestWinAppCI.CI_ID)
  AddOSConfigurationItems = ($objPSTestWinOSCI.CI_ID,$objPSTestMacCI.CI_ID)
  AddOptionalConfigurationItems = ($objPSTestWinAppCI2.CI_ID,$objPSTestWinAppCI3.CI_ID)
}

Set-CMBaseline @parameters

Example 2: Add a custom category

This example first uses the New-CMCategory cmdlet to create a custom baseline category Accounting. It then configures the Accounting baseline to add the new category.

$category = New-CMCategory -CategoryType BaselineCategories -Name "Accounting"
Set-CMBaseline -Name "Accounting baseline" -AddCategory $category.LocalizedCategoryInstanceName

Parameters

-AddBaseline

Specify an array of baseline IDs to add as configuration data to the target baseline. This value is the CI_ID property of the baseline, for example, 16777516.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:AddBaselines

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AddCategory

Specify an array of configuration category names to add to the configuration baselines. These categories improve searching and filtering. By default, the site includes the following categories for configuration baselines:

  • Client
  • IT Infrastructure
  • Line of Business
  • Server

To use another category, first add it with the New-CMCategory cmdlet and -CategoryType BaselineCategories parameter.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AddOptionalConfigurationItem

Specify an array of configuration item IDs to add with an optional purpose. The Configuration Manager client only evaluates optional items if the relevant application exists on the device.

This value is the CI_ID property of the configuration item, for example, 16777514.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:AddOptionalConfigurationItems

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AddOSConfigurationItem

Specify an array of configuration item IDs to add of type OS. This value is the CI_ID property of the configuration item, for example, 16777514.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:AddOSConfigurationItems

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AddProhibitedConfigurationItem

Specify an array of configuration item IDs to add with a prohibited purpose. This value is the CI_ID property of the configuration item, for example, 16777514.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:AddProhibitedConfigurationItems

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AddRequiredConfigurationItem

Specify an array of configuration item IDs to add with a required purpose. This value is the CI_ID property of the configuration item, for example, 16777514.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:AddRequiredConfigurationItems

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AddSoftwareUpdate

Specify an array of software update IDs to add.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:AddSoftwareUpdates

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AllowComanagedClients

Set this parameter to $true to always apply this baseline even for co-managed clients.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ClearBaseline

Add this parameter to remove all baselines as evaluation conditions from the target baseline. To remove individual baselines, use the RemoveBaseline parameter.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ClearOptionalConfigurationItem

Add this parameter to remove all optional configuration items as evaluation conditions from the target baseline. To remove individual optional CIs, use the RemoveOptionalConfigurationItem parameter.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ClearOSConfigurationItem

Add this parameter to remove all OS configuration items as evaluation conditions from the target baseline. To remove individual OS CIs, use the RemoveOSConfigurationItem parameter.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ClearProhibitedConfigurationItem

Add this parameter to remove all prohibited configuration items as evaluation conditions from the target baseline. To remove individual prohibited CIs, use the RemoveProhibitedConfigurationItem parameter.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ClearRequiredConfigurationItem

Add this parameter to remove all required configuration items as evaluation conditions from the target baseline. To remove individual required CIs, use the RemoveRequiredConfigurationItem parameter.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ClearSoftwareUpdate

Add this parameter to remove all software updates as evaluation conditions from the target baseline. To remove individual software updates, use the RemoveSoftwareUpdate parameter.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Description

Specify an optional description of the configuration baseline to help identify it.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:LocalizedDescription

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DesiredConfigurationDigestPath

Specify a path to the configuration data stored as an XML digest.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

Specify the CI_ID of the configuration baseline to configure. For example, 16777516.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:CIId, CI_ID

Parameter sets

SetByIdMandatory
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Specify a configuration baseline object to configure. To get this object, use the Get-CMBaseline cmdlet.

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetByValueMandatory
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specify the name of the configuration baseline to configure.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:LocalizedDisplayName

Parameter sets

SetByNameMandatory
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NewName

Specify a new name for the configuration baseline. Use this parameter to rename the target baseline.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PassThru

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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RemoveBaseline

Specify an array of baseline IDs to remove as configuration data from the target baseline. This value is the CI_ID property of the baseline, for example, 16777516. To remove all baselines as configuration data from this baseline, use the ClearBaseline parameter.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:RemoveBaselines

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RemoveCategory

Specify an array of configuration category names to remove from the configuration baseline.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RemoveOptionalConfigurationItem

Specify an array of optional CI IDs to remove as configuration data from the target baseline. This value is the CI_ID property of the configuration item, for example, 16777514. To remove all optional configuration items from this baseline, use the ClearOptionalConfigurationItem parameter.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:RemoveOptionalConfigurationItems

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RemoveOSConfigurationItem

Specify an array of OS CI IDs to remove as configuration data from the target baseline. This value is the CI_ID property of the configuration item, for example, 16777514. To remove all OS configuration items from this baseline, use the ClearOSConfigurationItem parameter.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:RemoveOSConfigurationItems

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RemoveProhibitedConfigurationItem

Specify an array of prohibited CI IDs to remove as configuration data from the target baseline. This value is the CI_ID property of the configuration item, for example, 16777514. To remove all prohibited configuration items from this baseline, use the ClearProhibitedConfigurationItem parameter.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:RemoveProhibitedConfigurationItems

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RemoveRequiredConfigurationItem

Specify an array of required CI IDs to remove as configuration data from the target baseline. This value is the CI_ID property of the configuration item, for example, 16777514. To remove all required configuration items from this baseline, use the ClearRequiredConfigurationItem parameter.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:RemoveRequiredConfigurationItems

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RemoveSoftwareUpdate

Specify an array of software update IDs to remove as configuration data from the target baseline. To remove all software updates from this baseline, use the ClearSoftwareUpdate parameter.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:RemoveSoftwareUpdates

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object