Remove-CMConfigurationItem
Remove-CMConfigurationItem
Removes configuration items from Configuration Manager.
Syntax
Parameter Set: SearchByIdMandatory
Remove-CMConfigurationItem -Id <String[]> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SearchByNameMandatory
Remove-CMConfigurationItem -Name <String[]> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SearchByValueMandatory
Remove-CMConfigurationItem -InputObject <IResultObject> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Remove-CMConfigurationItem cmdlet removes specified configuration items from Microsoft System Center 2012 SP1 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. For more information about configuration items, see Introduction to Compliance Settings in Configuration Manager (https://go.microsoft.com/fwlink/?LinkId=211014) on TechNet.
Parameters
-Force
Forces the command to run without asking for user confirmation.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Id<String[]>
Specifies an array of identifiers for one or more configuration items. You can use a comma separated list.
Aliases |
CIId |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-InputObject<IResultObject>
Specifies a configuration item object. To obtain a configuration item object, you can use the Get-CMConfigurationItem cmdlet.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Name<String[]>
Specifies an array of names of configuration items.
Aliases |
LocalizedDisplayName |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Remove an item using an ID
This command removes a configuration item with the specified identifier.
PS C:\> Remove-CMConfigurationItem -Id "16777568"
Example 2: Remove an item using a name
This command removes a configuration item named ConfigItem76.
PS C:\> Remove-CMConfigurationItem -Name "ConfigItem76"
Example 3: Remove an item using a variable
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.
PS C:\> $CIObj=Get-CMConfigurationItem -Id "16777568"
PS C:\> Remove-CMConfigurationItem -InputObject $CIObj
Related topics
Get-CMConfigurationItemXMLDefinition
Get-CMConfigurationItemHistory
Introduction to Compliance Settings in Configuration Manager