New-CMAntimalwarePolicy

Create a policy object for antimalware settings.

Syntax

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.

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

-Description

Specify an optional description for the antimalware policy to help you identify it.

Type:String
Position:Named
Default value:None
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

-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

-Name

Specify a name for the antimalware policy.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters: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.

Type:PolicyType[]
Accepted values:ScheduledScans, ScanSettings, DefaultActions, RealTimeProtection, ExclusionSettings, Advanced, ThreatOverrides, MicrosoftActiveProtectionService, DefinitionUpdates
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

None

Outputs

IResultObject

Notes

For more information on this return object and its properties, see SMS_AntimalwareSettings server WMI class.