Remove-CMAntimalwarePolicy

Removes an antimalware policy for Endpoint Protection.

Syntax

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

Description

The Remove-CMAntiMalwarePolicy cmdlet removes an antimalware policy for System Center 2016 Endpoint Protection from Microsoft System Center 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, System Center Configuration Manager removes the antimalware agent from the client computers and applies the policy with the next highest priority. If no other policies exist, then the default antimalware policy is applied.

Examples

Example 1: Remove an antimalware policy by using ID

PS C:\> Remove-CMAntiMalwarePolicy -Id "16777217"

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

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

PS C:\> Remove-CMAntiMalwarePolicy -Name "D*"

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

Example 3: Remove an antimalware policy by using object variable

PS C:\> $AMPobj = Get-CMAntiMalwarePolicy -Id "16777217"
PS C:\> Remove-CMAntiMalwarePolicy -InputObject $AMPobj

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 $AMPobj variable.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Id

Specifies the ID of an antimalware policy object.

Type:String
Aliases:SettingsId
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies a CMAntiMalwarePolicy object.

Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of an antimalware policy.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

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

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