Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

New-MailContact

Applies to: Exchange Server 2010

Topic Last Modified: 2011-03-19

Use the New-MailContact cmdlet to create a new mail-enabled contact.


New-MailContact -Name <String> -ExternalEmailAddress <ProxyAddress> [-Alias <String>] [-ArbitrationMailbox <MailboxIdParameter>] [-Confirm [<SwitchParameter>]] [-DisplayName <String>] [-DomainController <Fqdn>] [-ExternalManaged <SwitchParameter>] [-FirstName <String>] [-Initials <String>] [-LastName <String>] [-MacAttachmentFormat <BinHex | UuEncode | AppleSingle | AppleDouble>] [-MessageBodyFormat <Text | Html | TextAndHtml>] [-MessageFormat <Text | Mime>] [-ModeratedBy <MultiValuedProperty>] [-ModerationEnabled <$true | $false>] [-Organization <OrganizationIdParameter>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-PartnerObjectId <Guid>] [-PrimarySmtpAddress <SmtpAddress>] [-SendModerationNotifications <Never | Internal | Always>] [-UsePreferMessageFormat <$true | $false>] [-WhatIf [<SwitchParameter>]]

Parameter Required Type Description

ExternalEmailAddress

Required

Microsoft.Exchange.Data.ProxyAddress

The ExternalEmailAddress parameter specifies the target e-mail address.

Name

Required

System.String

The Name parameter specifies the common name of the mail contact.

Alias

Optional

System.String

The Alias parameter specifies the alias of the mail contact.

ArbitrationMailbox

Optional

Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter

The ArbitrationMailbox parameter specifies the mailbox used to manage the moderation process.

Confirm

Optional

System.Management.Automation.SwitchParameter

The Confirm switch causes the command to pause processing and requires you to acknowledge what the command will do before processing continues. You don't have to specify a value with the Confirm switch.

DisplayName

Optional

System.String

The DisplayName parameter specifies the name displayed in Microsoft Outlook for the mail contact.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

The DomainController parameter specifies the fully qualified domain name (FQDN) of the domain controller that writes this configuration change to Active Directory.

ExternalManaged

Optional

System.Management.Automation.SwitchParameter

The ExternalManaged switch specifies the mail contact as one managed by an external application.

FirstName

Optional

System.String

The FirstName parameter specifies the first name of the mail contact.

Initials

Optional

System.String

The Initials parameter specifies the initials of the mail contact.

LastName

Optional

System.String

The LastName parameter specifies the 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 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 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 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.

ModeratedBy

Optional

Microsoft.Exchange.Data.MultiValuedProperty

The ModeratedBy parameter specifies the users who are responsible for moderating the messages sent to this mailbox. To designate more than one user, separate the users with commas.

This parameter is required if you set the ModerationEnabled parameter to $true. If you leave this parameter blank and there's a user already specified as the manager of this mailbox, the ModeratedBy parameter is automatically set by the ManagedBy parameter of the mailbox. Otherwise, an error is returned.

ModerationEnabled

Optional

System.Boolean

The ModerationEnabled parameter enables or disables moderation for the mailbox. To enable moderation, set this parameter to $true. To disable moderation, set this parameter to $false.

The default value is $false.

Organization

Optional

Microsoft.Exchange.Configuration.Tasks.OrganizationIdParameter

The Organization parameter is reserved for internal Microsoft use.

OrganizationalUnit

Optional

Microsoft.Exchange.Configuration.Tasks.OrganizationalUnitIdParameter

The OrganizationalUnit parameter specifies the organizational unit (OU) to which the new contact is added, for example, redmond.contoso.com/contacts.

PartnerObjectId

Optional

System.Guid

This parameter is reserved for internal Microsoft use.

PrimarySmtpAddress

Optional

Microsoft.Exchange.Data.SmtpAddress

The PrimarySmtpAddress parameter specifies the primary SMTP address for the mail contact. By default, the primary SMTP address is generated based on the default e-mail address policy. If you specify a primary SMTP address by using this parameter, the command sets the EmailAddressPolicyEnabled attribute of the mail contact to $false, and the e-mail addresses of this mail contact aren't automatically updated based on e-mail address policies.

SendModerationNotifications

Optional

Microsoft.Exchange.Data.Directory.Recipient.TransportModerationNotificationFlags

The SendModerationNotifications parameter specifies whether status notifications are sent to users when a message they sent to the moderated distribution group is rejected by one of the moderators. You can specify one of the following values:

  • Always
  • Internal
  • Never

Set this parameter to Always if you want notifications to be sent to all senders.

Set this parameter to Internal if you want notifications to be sent only to the senders internal to your organization.

Set this parameter to Never to disable all status notifications.

The default value is Never.

UsePreferMessageFormat

Optional

System.Boolean

The UsePreferMessageFormat parameter specifies whether recipient preferred message format settings are used. When set to $true, this parameter specifies that the recipient preferred message format settings override the global settings for mail sent to this user.

WhatIf

Optional

System.Management.Automation.SwitchParameter

The WhatIf switch instructs the command to simulate the actions that it would take on the object. By using the WhatIf switch, you can view what changes would occur without having to apply any of those changes. You don't have to specify a value with the WhatIf switch.

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

You need to be assigned permissions before you can run this cmdlet. Although all parameters for this cmdlet are listed in this topic, you may not have access to some parameters if they're not included in the permissions assigned to you. To see what permissions you need, see the "Recipient Provisioning Permissions" section in the Mailbox Permissions topic.

Error Description

 

 

Exceptions Description

 

 

This example creates a new mail-enabled contact using the required parameters and the OrganizationalUnit parameter.

New-MailContact -Name "Chris Ashton" -ExternalEmailAddress "Chris@tailspintoys.com" -OrganizationalUnit "Marketing" 
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.