Remove-CMConfigurationItem

Removes configuration items from Configuration Manager.

Syntax

Remove-CMConfigurationItem
      [-Force]
      [-Id] <Int32>
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMConfigurationItem
      [-Force]
      [-InputObject] <IResultObject>
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMConfigurationItem
      [-Force]
      [-Name] <String>
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-CMConfigurationItem cmdlet removes specified configuration items from Configuration Manager. You can specify items by ID, name, or by use of the cmdlet.

Configuration items contain one or more settings, along with compliance rules. Items usually define a unit of configuration you want to.

If you remove a configuration item that has been deployed to a collection, the deployment will also be removed.

For more information about configuration items, see Introduction to Compliance Settings 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: Remove an item using an ID

PS XYZ:\> Remove-CMConfigurationItem -Id "16777568"

This command removes a configuration item with the specified identifier.

Example 2: Remove an item using a name

PS XYZ:\> Remove-CMConfigurationItem -Name "ConfigItem76"

This command removes a configuration item named ConfigItem76.

Example 3: Remove an item using a variable

PS XYZ:\> $CIObj=Get-CMConfigurationItem -Id "16777568"
PS XYZ:\> Remove-CMConfigurationItem -InputObject $CIObj

The first command gets a configuration item with the specified identifier and stores it in the $CIObj variable.

The second command removes the item stored in the $CIObj variable.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
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

-Force

Forces the command to run without asking for user confirmation.

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

-Id

Specifies an array of identifiers for one or more configuration items. You can use a comma separated list.

Type:Int32
Aliases:CIId, CI_ID
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Specifies a configuration item object. To obtain a configuration item object, you can use the Get-CMConfigurationItem cmdlet.

Type:IResultObject
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies an array of names of configuration items.

Type:String
Aliases:LocalizedDisplayName
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:True

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object