MalwareFilterPolicy
Applies to : Exchange Server 2013, Exchange Server 2016, Exchange Server 2019, Exchange Server SE, Exchange Online, Built-in security add-on for on-premises mailboxes
This cmdlet is available in on-premises Exchange and in the cloud-based service. Some parameters and settings might be exclusive to one environment or the other.
Use the Set-MalwareFilterPolicy cmdlet to modify malware filter policies in your organization.
For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax.
You need to be assigned permissions before you can run this cmdlet. Although this article lists all parameters for the cmdlet, you might not have access to some parameters if they aren't included in the permissions assigned to you. To find the permissions required to run any cmdlet or parameter in your organization, see Find the permissions required to run any Exchange cmdlet.
Available cmdlets
Parameters
| Name | Type | Default value | Accepted values |
|---|---|---|---|
| AdminDisplayName | String | ||
| CustomExternalBody | String | ||
| CustomExternalSubject | String | ||
| CustomFromAddress | SmtpAddress | ||
| CustomFromName | String | ||
| CustomInternalBody | String | ||
| CustomInternalSubject | String | ||
| CustomNotifications | Boolean | ||
| EnableExternalSenderAdminNotifications | Boolean | ||
| EnableFileFilter | Boolean | ||
| EnableInternalSenderAdminNotifications | Boolean | ||
| ExternalSenderAdminAddress | SmtpAddress | ||
| FileTypeAction | FileTypeFilteringAction | ||
| FileTypes | String[] | ||
| InternalSenderAdminAddress | SmtpAddress | ||
| IsPolicyOverrideApplied | Boolean | ||
| MakeDefault | SwitchParameter | ||
| QuarantineTag | String | ||
| ZapEnabled | Boolean |
Examples
Example 1
Set-MalwareFilterPolicy -Identity "Contoso Malware Filter Policy" -Action DeleteMessage -EnableInternalSenderAdminNotifications $true -InternalSenderAdminAddress [email protected] In on-premises Exchange, this example modifies the malware filter policy named Contoso Malware Filter Policy with the following settings:
- Delete messages that contain malware.
- Don't notify the message sender when malware is detected in the message.
- Notify the administrator [email protected] when malware is detected in a message from an internal sender.
Example 2
$FileTypesAdd = Get-MalwareFilterPolicy -Identity Default | select -Expand FileTypes
$FileTypesAdd += "dgz","mde"
Set-MalwareFilterPolicy -Identity Default -EnableFileFilter $true -FileTypes $FileTypesAdd This example enables the common attachments filter in the malware filter policy named Default and adds the file types "dgz" and "mde" without affecting the other file type entries.
Example 3
$ft = Get-MalwareFilterPolicy -Identity Default
$a = [System.Collections.ArrayList]($ft.FileTypes)
$a
$a.RemoveAt(6)
Set-MalwareFilterPolicy -Identity Default -FileTypes $a This example modifies the malware filter policy named Default by removing an existing file type from the common attachments filter without affecting other file types that are already specified.
The first three commands return the existing list of file types. The first file type in the list has the index number 0, the second has the index number 1, and so on. Use the index number to specify the file type that you want to remove.
The last two commands remove the seventh file type that's displayed in the list.