Remove-CMAntimalwarePolicy
Remove an antimalware policy for endpoint protection.
Syntax
Remove-CMAntimalwarePolicy
[-Force]
-Id <String>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMAntimalwarePolicy
[-Force]
-InputObject <IResultObject>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-CMAntimalwarePolicy
[-Force]
-Name <String>
[-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.
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
Specify the Settings ID of the antimalware policy object to remove.
Type: | String |
Aliases: | SettingsId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Specify an antimalware policy object to remove. To get this object, use the Get-CMAntiMalwarePolicy cmdlet.
Type: | IResultObject |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specify the name of an antimalware policy to remove.
Type: | String |
Position: | Named |
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