Remove-CMConfigurationPolicy

Removes a configuration policy.

Syntax

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

Description

The Remove-CMConfigurationPolicy cmdlet removes a configuration policy. A configuration policy can be an email profile, a firewall policy, or others. See the Alias section for additional policy types that you can use this cmdlet to remove.

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 a configuration policy by ID

PS XYZ:\> Remove-CMConfigurationPolicy -ID 16777454 -Force

This command removes the configuration policy with the CI_ID of 16777454, without prompting the user for confirmation.

Example 2: Remove a configuration policy by name

PS XYZ:\> Get-CMcertificateProfilePfx -Name "CertProf1" | Remove-CMConfigurationPolicy

This command gets the PFX certificate profile object named CertProf01 and uses the pipeline operator to pass the object to Remove-CMConfigurationPolicy which removes the certificate profile.

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 the CI__ID of a configuration policy.

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 policy object. To obtain a configuration policy object, use the Get-CMConfigurationPolicy 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 policies.

Type:String[]
Aliases:LocalizedDisplayName
Position:0
Default value:None
Required:True
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:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object