New-CMAntimalwarePolicy
Create a policy object for antimalware settings.
Syntax
Default (Default)
New-CMAntimalwarePolicy
[-Description <String>]
-Name <String>
-Policy <PolicyType[]>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-CMAntimalwarePolicy cmdlet creates a policy object that specifies the antimalware settings for endpoint protection. The policy applies to collections of client computers that run a Configuration Manager agent. Antimalware policies are configuration settings that define how an antimalware agent operates on a client computer.
After you create the policy, use the Set-CMAntiMalwarePolicy cmdlet to configure the specific settings.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
Examples
Example 1: Create an antimalware policy
This command creates an antimalware policy named ExclustionsPolicy. This policy only defines exclusion settings. The command includes an optional description that further describes the policy.
New-CMAntimalwarePolicy -Name "ExclusionsPolicy" -Policy ExclusionSettings -Description "Policy defining exclusions."
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 |
-Description
Specify an optional description for the antimalware policy to help you identify it.
Parameter properties
Type: | String |
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 |
-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 |
-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 |
-Name
Specify a name for the antimalware policy.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Policy
Specify the type of antimalware settings that this policy includes. You use the Set-CMAntiMalwarePolicy cmdlet to configure settings for the policy types that you add with New-CMAntimalwarePolicy -Policy
. If you use Set-CMAntiMalwarePolicy to configure settings for policy types that weren't originally added, it adds the types when you configure the settings.
Parameter properties
Type: | PolicyType[] |
Default value: | None |
Accepted values: | ScheduledScans, ScanSettings, DefaultActions, RealTimeProtection, ExclusionSettings, Advanced, ThreatOverrides, MicrosoftActiveProtectionService, DefinitionUpdates |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
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
None
Outputs
IResultObject
Notes
For more information on this return object and its properties, see SMS_AntimalwareSettings server WMI class.