Remove-CMAntiMalwarePolicy
Remove-CMAntiMalwarePolicy
Removes an antimalware policy for Endpoint Protection.
Syntax
Parameter Set: SearchByIdMandatory
Remove-CMAntiMalwarePolicy -Id <String> [-Force] [-SecuredScopeNames <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SearchByNameMandatory
Remove-CMAntiMalwarePolicy -Name <String> [-Force] [-SecuredScopeNames <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SearchByValueMandatory
Remove-CMAntiMalwarePolicy -InputObject <IResultObject> [-Force] [-SecuredScopeNames <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Remove-CMAntiMalwarePolicy cmdlet removes an antimalware policy for System Center 2012 Endpoint Protection from Microsoft System Center 2012 SP1 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 2012 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.
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 the ID of an antimalware policy object.
Aliases |
SettingsId |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-InputObject<IResultObject>
Specifies a CMAntiMalwarePolicy object.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Name<String>
Specifies the name of an antimalware policy.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-SecuredScopeNames<String>
Specifies the names of secured scopes.
Aliases |
none |
Required? |
false |
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 antimalware policy by using ID
This command removes the antimalware policy that has the ID 16777217.
PS C:\> Remove-CMAntiMalwarePolicy -Id "16777217"
Example 2: Remove an antimalware policy by using a wildcard character
This command removes antimalware policies that have a name that begins with the letter D.
PS C:\> 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 $AMPobj variable.
PS C:\> $AMPobj = Get-CMAntiMalwarePolicy -Id "16777217"
PS C:\> Remove-CMAntiMalwarePolicy -InputObject $AMPobj