Set-MailContact

 

适用于: Exchange Server 2007 SP3, Exchange Server 2007 SP2, Exchange Server 2007 SP1

上一次修改主题: 2011-01-26

使用 Set-MailContact cmdlet 可修改 Active Directory 目录服务中现有已启用邮件的联系人。

语法

Set-MailContact -Identity <MailContactIdParameter> [-AcceptMessagesOnlyFrom <RecipientIdParameter[]>] [-AcceptMessagesOnlyFromDLMembers <RecipientIdParameter[]>] [-Alias <String>] [-Confirm [<SwitchParameter>]] [-CreateDTMFMap <$true | $false>] [-CustomAttribute1 <String>] [-CustomAttribute10 <String>] [-CustomAttribute11 <String>] [-CustomAttribute12 <String>] [-CustomAttribute13 <String>] [-CustomAttribute14 <String>] [-CustomAttribute15 <String>] [-CustomAttribute2 <String>] [-CustomAttribute3 <String>] [-CustomAttribute4 <String>] [-CustomAttribute5 <String>] [-CustomAttribute6 <String>] [-CustomAttribute7 <String>] [-CustomAttribute8 <String>] [-CustomAttribute9 <String>] [-DisplayName <String>] [-DomainController <Fqdn>] [-EmailAddresses <ProxyAddressCollection>] [-EmailAddressPolicyEnabled <$true | $false>] [-Extensions <MultiValuedProperty>] [-ExternalEmailAddress <ProxyAddress>] [-GrantSendOnBehalfTo <MailboxOrMailUserIdParameter[]>] [-HiddenFromAddressListsEnabled <$true | $false>] [-IgnoreDefaultScope <SwitchParameter>] [-MacAttachmentFormat <BinHex | AppleSingle | AppleDouble>] [-MaxReceiveSize <Unlimited>] [-MaxRecipientPerMessage <Unlimited>] [-MaxSendSize <Unlimited>] [-MessageBodyFormat <Text | Html | TextAndHtml>] [-MessageFormat <Text | Mime>] [-Name <String>] [-PrimarySmtpAddress <SmtpAddress>] [-RejectMessagesFrom <RecipientIdParameter[]>] [-RejectMessagesFromDLMembers <RecipientIdParameter[]>] [-RequireSenderAuthenticationEnabled <$true | $false>] [-SecondaryAddress <String>] [-SecondaryDialPlan <UMDialPlanIdParameter>] [-SimpleDisplayName <String>] [-UMDtmfMap <MultiValuedProperty>] [-UseMapiRichTextFormat <Never | Always | UseDefaultSettings>] [-UsePreferMessageFormat <$true | $false>] [-UseRusServer <String>] [-WhatIf [<SwitchParameter>]] [-WindowsEmailAddress <SmtpAddress>]

Set-MailContact [-AcceptMessagesOnlyFrom <RecipientIdParameter[]>] [-AcceptMessagesOnlyFromDLMembers <RecipientIdParameter[]>] [-Alias <String>] [-Confirm [<SwitchParameter>]] [-CreateDTMFMap <$true | $false>] [-CustomAttribute1 <String>] [-CustomAttribute10 <String>] [-CustomAttribute11 <String>] [-CustomAttribute12 <String>] [-CustomAttribute13 <String>] [-CustomAttribute14 <String>] [-CustomAttribute15 <String>] [-CustomAttribute2 <String>] [-CustomAttribute3 <String>] [-CustomAttribute4 <String>] [-CustomAttribute5 <String>] [-CustomAttribute6 <String>] [-CustomAttribute7 <String>] [-CustomAttribute8 <String>] [-CustomAttribute9 <String>] [-DisplayName <String>] [-DomainController <Fqdn>] [-EmailAddresses <ProxyAddressCollection>] [-EmailAddressPolicyEnabled <$true | $false>] [-Extensions <MultiValuedProperty>] [-ExternalEmailAddress <ProxyAddress>] [-GrantSendOnBehalfTo <MailboxOrMailUserIdParameter[]>] [-HiddenFromAddressListsEnabled <$true | $false>] [-IgnoreDefaultScope <SwitchParameter>] [-Instance <MailContact>] [-MacAttachmentFormat <BinHex | AppleSingle | AppleDouble>] [-MaxReceiveSize <Unlimited>] [-MaxRecipientPerMessage <Unlimited>] [-MaxSendSize <Unlimited>] [-MessageBodyFormat <Text | Html | TextAndHtml>] [-MessageFormat <Text | Mime>] [-Name <String>] [-PrimarySmtpAddress <SmtpAddress>] [-RejectMessagesFrom <RecipientIdParameter[]>] [-RejectMessagesFromDLMembers <RecipientIdParameter[]>] [-RequireSenderAuthenticationEnabled <$true | $false>] [-SecondaryAddress <String>] [-SecondaryDialPlan <UMDialPlanIdParameter>] [-SimpleDisplayName <String>] [-UMDtmfMap <MultiValuedProperty>] [-UseMapiRichTextFormat <Never | Always | UseDefaultSettings>] [-UsePreferMessageFormat <$true | $false>] [-UseRusServer <String>] [-WhatIf [<SwitchParameter>]] [-WindowsEmailAddress <SmtpAddress>]

详细说明

通过指定要修改的 Active Directory 中现有已启用邮件的联系人的标识和属性,Set-MailContact cmdlet 可以修改此联系人。

若要运行 Set-MailContact cmdlet,必须为您使用的帐户委派以下角色:

  • Exchange 收件人管理员角色

有关管理 Microsoft Exchange Server 2007 所需的权限、角色委派以及权利的详细信息,请参阅权限注意事项

参数

参数 必需 类型 说明

Identity

必需

Microsoft.Exchange.Configuration.Tasks.MailContactIdParameter

Identity 参数接受以下值之一:

  • ADObjectID

  • GUID

  • 可分辨名称 (DN)

  • 域\SAM 帐户名

  • 用户主体名称 (UPN)

  • 旧版 DN

  • 电子邮件地址

  • 联系人别名

AcceptMessagesOnlyFrom

可选

Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter[]

AcceptMessagesOnlyFrom 参数指定可以向此邮件联系人发送电子邮件的邮箱用户、邮件用户和邮件联系人。还可以将 Microsoft Exchange 指定为此参数的有效收件人。如果您将邮件联系人配置为仅接受来自 Microsoft Exchange 收件人的邮件,它将仅接收系统生成的邮件。

AcceptMessagesOnlyFrom 参数可以接受以下任何一个值代表有效发件人:

  • 可分辨名称 (DN)

  • 规范名称

  • GUID

  • 名称

  • 显示名称

  • 别名

  • Exchange DN

  • 主 SMTP 电子邮件地址

默认情况下,此参数为空。此默认值使邮件联系人能够接受来自所有发件人的邮件。

AcceptMessagesOnlyFromDLMembers

可选

Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter[]

AcceptMessagesOnlyFromDLMembers 参数指定允许其成员向此邮件联系人发送电子邮件的通讯组。可以使用下列任何一个值来代表允许的通讯组:

  • 可分辨名称 (DN)

  • 规范名称

  • GUID

  • 名称

  • 显示名称

  • 旧版 Exchange DN

  • 主 SMTP 电子邮件地址

默认情况下,此参数为空。此默认值使邮件联系人能够接受来自所有发件人的邮件。

别名

可选

System.String

Alias 参数指定已启用邮件的联系人的别名。别名可以包含字母、数字以及下列标点符号和符号:

  • !

  • #

  • $

  • %

  • ^

  • &

  • *

  • +

  • -

  • .

  • /

  • =

  • ?

  • _

  • {

  • }

  • |

  • ~

Confirm

可选

System.Management.Automation.SwitchParameter

Confirm 参数将导致命令暂停处理,并且需要您在处理继续之前确认该命令将执行的操作。不必为 Confirm 参数指定值。

CreateDTMFMap

可选

System.Boolean

此参数指定为联系人创建的双音多频 (DTMF) 映射。

CustomAttribute1

可选

System.String

CustomAttribute1 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute10

可选

System.String

CustomAttribute10 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute11

可选

System.String

CustomAttribute11 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute12

可选

System.String

CustomAttribute12 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute13

可选

System.String

CustomAttribute13 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute14

可选

System.String

CustomAttribute14 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute15

可选

System.String

CustomAttribute15 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute2

可选

System.String

CustomAttribute2 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute3

可选

System.String

CustomAttribute3 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute4

可选

System.String

CustomAttribute4 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute5

可选

System.String

CustomAttribute5 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute6

可选

System.String

CustomAttribute6 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute7

可选

System.String

CustomAttribute7 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute8

可选

System.String

CustomAttribute8 参数指定自定义属性。可以使用这些属性存储其他信息。

CustomAttribute9

可选

System.String

CustomAttribute9 参数指定自定义属性。可以使用这些属性存储其他信息。

DisplayName

可选

System.String

DisplayName 参数指定用户的显示名称。

DomainController

可选

Microsoft.Exchange.Data.Fqdn

若要指定将此配置更改写入 Active Directory 域控制器的完全限定的域名 (FQDN),请在命令中包含 DomainController 参数。

EmailAddresses

可选

Microsoft.Exchange.Data.ProxyAddressCollection

可以使用 EmailAddresses 参数指定邮件联系人的电子邮件别名。可以使用所有有效的 Microsoft Exchange 2007 电子邮件地址类型。可以采用逗号分隔列表形式为 EmailAddresses 参数指定多个值。

important要点:
Exchange 2007 不验证自定义地址的格式是否正确。您必须确保指定的自定义地址符合该地址类型的格式要求。因为 X.400 地址在 Exchange 2007 中被视为自定义地址,所以不会验证这些地址。因此,在指定 X.400 地址时必须提供正确的语法。

EmailAddressPolicyEnabled

可选

System.Boolean

EmailAddressPolicyEnabled 参数指定是否根据定义的电子邮件地址策略自动更新邮箱的电子邮件地址。

Extensions

可选

Microsoft.Exchange.Data.MultiValuedProperty

此参数指定联系人的一个或多个分机号码。设置了此参数时,拨号计划中的所有分机号码必须是唯一的。

ExternalEmailAddress

可选

Microsoft.Exchange.Data.ProxyAddress

ExternalEmailAddress 参数指定收件人的外部电子邮件地址。

GrantSendOnBehalfTo

可选

Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter

GrantSendOnBehalfTo 参数指定可以代表此联系人发送邮件的收件人的可分辨名称 (DN)。

HiddenFromAddressListsEnabled

可选

System.Boolean

HiddenFromAddressListsEnabled 参数指定联系人是否显示在地址列表中。如果值为 $true,联系人将不在地址列表中显示。默认值为 $false。

IgnoreDefaultScope

可选

System.Management.Automation.SwitchParameter

IgnoreDefaultScope 参数指示命令忽略 Exchange 命令行管理程序的默认收件人作用域设置,并使用整个林作为作用域。这样,该命令可以访问当前不在默认作用域中的 Active Directory 对象。使用 IgnoreDefaultScope 参数时将受到下列限制:

  • 不能使用 DomainController 参数。该命令将自动使用相应的全局编录服务器。

  • 仅可以对 Identity 参数使用 DN。不接受其他形式的标识,如别名或 GUID。

Instance

可选

Microsoft.Exchange.Data.Directory.Management.MailContact

使用 Instance 参数可以将整个对象传递给此命令以进行处理。该参数主要用于必须将整个对象传递给命令的脚本。

MacAttachmentFormat

可选

Microsoft.Exchange.Data.Directory.Recipient.MacAttachmentFormat

MacAttachmentFormat 参数指定要发送到邮件联系人的邮件的 Apple Macintosh 操作系统附件格式。此参数的有效值包括:

  • BinHex

  • AppleSingle

  • AppleDouble

默认情况下,此参数设置为 BinHex。

MacAttachmentFormat 参数可接受的值取决于 MessageFormat 参数。如果 MessageFormat 参数设置为 Text,则只能将 BinHex 值用作此参数。如果 MessageFormat 参数设置为 Mime,则只能将 BinHex、AppleSingle 或 AppleDouble 用作此参数的值。

MaxReceiveSize

可选

Microsoft.Exchange.Data.Unlimited

MaxReceiveSize 参数指定可以接收的电子邮件的最大大小,范围为 1 KB 到 2,097,151 KB。

如果没有指定值,则会将该限制设置为最大值。

MaxRecipientPerMessage

可选

Microsoft.Exchange.Data.Unlimited

MaxRecipientPerMessage 参数指定来自此邮件联系人的邮件的最多收件人数。

MaxSendSize

可选

Microsoft.Exchange.Data.Unlimited

MaxSendSize 参数指定可以发送的电子邮件的最大大小,范围为 1 KB 到 2,097,151 KB。

如果没有指定值,则会将该限制设置为最大值。

MessageBodyFormat

可选

Microsoft.Exchange.Data.Directory.Recipient.MessageBodyFormat

MessageBodyFormat 参数指定要发送到邮件联系人的邮件的邮件正文格式。此参数的有效值包括:

  • Text

  • Html

  • TextAndHtml

默认情况下,此参数设置为 TextAndHtml。

MessageFormatMessageBodyFormat 参数相互依赖。如果 MessageFormat 参数设置为 Mime,MessageBodyFormat 参数可以设置为任意有效值。但是,如果 MessageFormat 参数设置为 Text,MessageBodyFormat 参数只能设置为 Text。因此,如果要将此参数设置为 Html 或 TextAndHtml,就必须将 MessageFormat 参数设置为 Mime。

MessageFormat

可选

Microsoft.Exchange.Data.Directory.Recipient.MessageFormat

MessageFormat 参数指定发送到邮件联系人的邮件的邮件正文格式。

此参数的有效值包括:

  • Text

  • MIME

默认情况下,此参数设置为 Mime。

MessageFormatMessageBodyFormat 参数相互依赖。如果 MessageFormat 参数设置为 Mime,MessageBodyFormat 参数可以设置为任意有效值。但是,如果 MessageFormat 参数设置为 Text,MessageBodyFormat 参数只能设置为 Text。因此,如果要将 MessageFormat 参数从 Mime 更改为 Text,就必须将 MessageBodyFormat 参数更改为 Text。

名称

可选

System.String

Name 参数指定已启用邮件的联系人的姓名。

PrimarySmtpAddress

可选

Microsoft.Exchange.Data.SmtpAddress

PrimarySmtpAddress 参数指定主 SMTP 电子邮件地址。

RejectMessagesFrom

可选

Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter[]

RejectMessagesFrom 参数指定拒绝从其接受邮件的收件人。

RejectMessagesFromDLMembers

可选

Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter[]

RejectMessagesFromDLMembers 参数指定拒绝从其接受邮件的通讯组列表成员。

RequireSenderAuthenticationEnabled

可选

System.Boolean

RequireSenderAuthenticationEnabled 参数指定是否只接受已通过身份验证的收件人的邮件。默认值为 $false。

SecondaryAddress

可选

System.String

此参数指定启用 UM 的联系人使用的辅地址。

SecondaryDialPlan

可选

Microsoft.Exchange.Configuration.Tasks.UMDialPlanIdParameter

此参数指定要使用的辅助 UM 拨号计划。此参数用于创建辅助代理地址。

SimpleDisplayName

可选

System.String

如果只允许使用有限的一组字符,则使用 SimpleDisplayName 参数显示对象的备用说明。这组有限的字符包括从 26 到 126 的 ASCII 字符(含 26 和 126)。

UMDtmfMap

可选

Microsoft.Exchange.Data.MultiValuedProperty

此参数指定是否需要为启用 UM 的联系人创建用户定义的 DTMF 映射。

UseMapiRichTextFormat

可选

Microsoft.Exchange.Data.Directory.Recipient.UseMapiRichTextFormat

UseMapiRichTextFormat 参数指定如何为此邮件联系人处理 MAPI RTF 格式的邮件。将此参数设置为 Never,可以将发送给此联系人的全部邮件转换为纯文本。将此参数设置为 Always,可以始终以 MAPI RTF 格式向此联系人发送邮件。将此参数设置为 UseDefaultSettings,可以根据在发送邮件的 MAPI 客户端中配置的设置决定邮件格式。

UsePreferMessageFormat

可选

System.Boolean

UsePreferMessageFormat 参数指定为邮件联系人配置的邮件格式设置是否覆盖为远程域配置的全局设置。将此参数设置为 $true,则可以用为邮件联系人配置的邮件格式设置覆盖全局设置。

UseRusServer

可选

System.String

note注意:
此参数仅在 Exchange 2007 SP2 中可用。

UseRusServer 参数指示该命令使用运行地址列表服务的邮箱服务器获取并设置邮箱和 Active Directory 用户属性。

地址列表服务是 Exchange 系统助理服务的一个组件。地址列表服务创建和维护 Active Directory 中 Exchange 特定的属性值。通过使用特定信息(如地址列表成员身份和电子邮件地址),您可以使用地址列表服务来更新域中的收件人对象。

WhatIf

可选

System.Management.Automation.SwitchParameter

WhatIf 参数指示命令模拟对对象执行的操作。通过使用 WhatIf 参数,您可以查看要发生的更改,而不必应用任何这些更改。不必为 WhatIf 参数指定值。

WindowsEmailAddress

可选

Microsoft.Exchange.Data.SmtpAddress

WindowsEmailAddress 参数指定此邮箱的 Windows 电子邮件地址。Exchange 不使用此地址。

输入类型

返回类型

错误

错误 说明

 

异常

异常 说明

 

示例

在本示例中,Set-MailContact 命令用于将 John Peoples 的外部电子邮件地址设置为 john@contoso.com。

Set-MailContact -Identity "John Peoples" -ExternalEmailAddress "john@contoso.com"