New-MailContact (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

You can use the New-MailContact command to create a new mail-enabled contact.

Syntax

New-MailContact -Name <String> -ExternalEmailAddress <ProxyAddress> -OrganizationalUnit <OrganizationalUnitIdParameter> [-Alias <String>] [-DisplayName <String>] [-DomainController <Fqdn>] [-FirstName <String>] [-Initials <String>] [-LastName <String>] [-MacAttachmentFormat <BinHex | UuEncode | AppleSingle | AppleDouble>] [-MessageBodyFormat <Text | Html | TextAndHtml>] [-MessageFormat <Text | Mime>] [-TemplateInstance <PSObject>] [-UsePreferMessageFormat <$true | $false>]

Detailed Description

The New-MailContact command creates a new mail contact object in the Microsoft Active Directory and then mail-enables the mail contact.

To run New-MailContact cmdlet, the account you use must be delegated the following:

  • Exchange Recipient Administrator role

  • Account Operator role for the applicable Active Directory containers

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

Parameters

Parameter Required Type Description

ExternalEmailAddress

Required

Microsoft.Exchange.Data.ProxyAddress

Target e-mail address.

Name

Required

System.String

Common name of the mail contact.

OrganizationalUnit

Required

Microsoft.Exchange.Configuration.Tasks.OrganizationalUnitIdParameter

The organizational unit to which the new contact is added. For example, redmond.contoso.com/contacts.

Alias

Optional

System.String

Alias of the mail contact.

DisplayName

Optional

System.String

The name that will be displayed in Microsoft Outlook for the mail contact.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

To specify the fully qualified domain name of the domain controller that writes this configuration change to Active Directory, include the DomainController parameter on the command.

FirstName

Optional

System.String

First name of the mail contact.

Initials

Optional

System.String

Initials of the mail contact.

LastName

Optional

System.String

Last name of the mail contact.

MacAttachmentFormat

Optional

Microsoft.Exchange.Data.Directory.Recipient.MacAttachmentFormat

The MacAttachmentFormat parameter specifies the Apple Macintosh Operating System attachment format for messages that are sent to the mail contact. The valid values for this parameter are:

  • BinHex

  • UUENCODE

  • AppleSingle

  • AppleDouble

By default, this parameter is set to BinHex.

The acceptable values for the MacAttachmentFormat parameter are dependent on the MessageFormat parameter. If the MessageFormat parameter is set to Text, you can only use BinHex or UUENCODE values for this parameter. If the MessageFormat parameter is set to Mime, you can only use BinHex, AppleSingle or AppleDouble values for this parameter.

MessageBodyFormat

Optional

Microsoft.Exchange.Data.Directory.Recipient.MessageBodyFormat

The MessageBodyFormat parameter specifies the message body format for messages that are sent to the mail contact. The valid values for this parameter are:

  • Text

  • Html

  • TextAndHtml

By default, this parameter is set to TextAndHtml.

The MessageFormat and MessageBodyFormat parameters are interdependent. If the MessageFormat parameter is set to Mime, the MessageBodyFormat parameter can be set to any valid value. However, if the MessageFormat parameter is set to Text, the MessageBodyFormat parameter can only be set to Text. Therefore, if you want to set this parameter to Html or TextAndHtml, you must also set the MessageFormat parameter to Mime.

MessageFormat

Optional

Microsoft.Exchange.Data.Directory.Recipient.MessageFormat

The MessageFormat parameter specifies the message format for messages that are sent to the mail contact.

The valid values for this parameter are:

  • Text

  • Mime

By default, this parameter is set to Mime.

The MessageFormat and MessageBodyFormat parameters are interdependent. If the MessageFormat parameter is set to Mime, the MessageBodyFormat parameter can be set to any valid value. However, if the MessageFormat parameter is set to Text, the MessageBodyFormat parameter can only be set to Text. Therefore, if you want to change the MessageFormat parameter from Mime to Text, you must also change the MessageBodyFormat parameter to Text.

TemplateInstance

Optional

System.Management.Automation.PSObject

When an existing object is supplied to this parameter, the command will use that object's configuration to create an exact duplicate of the object on a local or target server.

UsePreferMessageFormat

Optional

System.Boolean

When set to true, this parameter specifies that the recipient preferred message format settings will override the global settings for mail sent to this user.

Input Types

Return Types

Errors

Error Description

Exceptions

Exceptions Description

Example

In the following example, the New-MailContact command is used to create a new mail-enabled contact.

New-MailContact -Name "Ted Bremer" -ExternalEmailAddress "ted@tailspintoys.com" -OrganizationalUnit "Marketing"