Share via


Add-AttachmentFilterEntry (RTM)

Microsoft Exchange Server 2007 will reach end of support on April 11, 2017. To stay supported, you will need to upgrade. For more information, see Resources to help you upgrade your Office 2007 servers and clients.

 

Applies to: Exchange Server 2007

Use the Add-AttachmentFilterEntry cmdlet to add an entry to the attachment filter list on a computer that has the Edge Transport server role installed.

Syntax

add-attachmentfilterentry -Name <String> -Type <ContentType | FileName> [-DomainController <Fqdn>]

Detailed Description

The Attachment Filter agent can block attachments from entering the Microsoft Exchange Server 2007 organization based on the content type and the file name of the attachment. The configuration of the Attachment Filtering agent determines how attachments are processed.

For more information about how to configure the Attachment Filtering agent, see Set-AttachmentFilterListConfig (RTM).

The Add-AttachmentFilterEntry cmdlet can filter e-mail attachments based on MIME content types and file name. The following list describes each attachment type:

  • MIME content types   MIME content types indicate what the attachment is, for example, whether it's a JPEG image, an executable file, a Microsoft Office Excel 2003 file, or another file type. E-mail attachments are encoded in e-mail messages as ASCII text. E-mail servers and clients use the information about MIME content type to decode the ASCII text information in an e-mail message and convert it into a usable binary file that is familiar to the user. Content types are expressed as type/subtype. For example, the JPEG image content type is expressed as image/jpeg.

    For more information about MIME content types, see Request for Comments (RFC) 1341.

  • File names   There are two ways to specify attachment file names in the attachment filter lists. You can specify an exact file name, such as BadFilename.exe. Alternatively, you can specify any file that has a specific type of extension by replacing the file name to the left of the period with a wildcard character. An example of using a wildcard character in a file name is *.exe.

To run the Add-AttachmentFilterEntry cmdlet on a computer that has the Edge Transport server role installed, you must log on by using an account that is a member of the local Administrators group on that computer.

For more information about permissions, delegating roles, and the rights that are required to administer Exchange 2007, see Permission Considerations.

Parameters

Parameter Required Type Description

Name

Required

System.String

This parameter specifies the MIME content type or file name of the attachment. If Type is FileName, the Name parameter can take any exact file name, such as BadFile.Exe, or file name extension, such as *.exe. If Type is ContentType, the Name parameter can take any valid MIME content type.

Type

Required

Microsoft.Exchange.Data.Directory.SystemConfiguration.AttachmentType

This parameter specifies what type of attachment the attachment filter entry blocks. Valid values are ContentType and Filename.

  • ContentType   This value matches the attachment filter entry against the MIME content type that is specified in the AttachmentName parameter.

  • FileName   This value matches the attachment filter entry against the simple file name that is specified in the AttachmentName parameter.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

To specify the fully qualified domain name (FQDN) of the domain controller that writes this configuration change to Active Directory directory service, include the DomainController parameter on the command. The DomainController parameter is not supported on computers that have the Edge Transport server role installed. The Edge Transport server role writes only to the local ADAM instance.

Input Types

Return Types

Errors

Error Description

Exceptions

Exceptions Description

Example

You may want to add entries to the attachment filter list to help protect users from malicious or inappropriate e-mail attachments. The following code examples show how to add an entry to the attachment filter list.

The first code example adds an attachment filter entry based on a file name. This attachment filter will be applied to all attachments that have a .txt extension.

The second code example adds an attachment filter entry based on the MIME content type image/jpeg, which is a JPEG image binary file. This attachment filter will be applied to all attachments of the MIME content type image/jpeg.

add-attachmentfilterentry -name *.txt -type FileName
add-attachmentfilterentry -name image/jpeg -type ContentType