Edit

Share via


Remove-CMAntimalwarePolicy

Remove an antimalware policy for endpoint protection.

Syntax

SearchByIdMandatory (Default)

Remove-CMAntimalwarePolicy
    -Id <String>
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SearchByValueMandatory

Remove-CMAntimalwarePolicy
    -InputObject <IResultObject>
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SearchByNameMandatory

Remove-CMAntimalwarePolicy
    -Name <String>
    [-Force]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-CMAntiMalwarePolicy cmdlet removes an antimalware policy for endpoint protection from Configuration Manager.

When you create an antimalware policy for endpoint protection and deploy it to a collection of client computers, this antimalware policy overrides the default antimalware policy. When you remove an antimalware policy for endpoint protection, Configuration Manager applies the policy with the next highest priority. If no other custom policies exist, then it applies the default antimalware policy.

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 antimalware policy by using ID

This command removes the antimalware policy that has the ID 16777217.

Remove-CMAntiMalwarePolicy -Id "16777217"

Example 2: Remove an antimalware policy by using a wildcard character

This command removes all antimalware policies that have a name that begins with the letter D.

Remove-CMAntiMalwarePolicy -Name "D*"

Example 3: Remove an antimalware policy by using object variable

The first command gets an antimalware policy object that has the ID 16777217 and stores it in the $AMPobj variable.

The second command removes the antimalware policy stored in the variable.

$AMPobj = Get-CMAntiMalwarePolicy -Id "16777217"
Remove-CMAntiMalwarePolicy -InputObject $AMPobj -Force

Parameters

-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

-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

-Force

Forces the command to run without asking for user confirmation.

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 Settings ID of the antimalware policy object to remove.

Parameter properties

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

Parameter sets

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

-InputObject

Specify an antimalware policy object to remove. To get this object, use the Get-CMAntiMalwarePolicy cmdlet.

Parameter properties

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

Parameter sets

SearchByValueMandatory
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 an antimalware policy to remove.

Parameter properties

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

Parameter sets

SearchByNameMandatory
Position:Named
Mandatory:True
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