适用于: Exchange Server 2007
上一次修改主题: 2007-06-05
使用 Set-MailContact cmdlet 可修改 Active Directory 目录服务中现有已启用邮件的联系人。
语法
Set-MailContact -Identity <MailContactIdParameter> [-AcceptMessagesOnlyFrom <RecipientIdParameter[]>] [-AcceptMessagesOnlyFromDLMembers <RecipientIdParameter[]>] [-Alias <String>] [-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>] [-MacAttachmentFormat <BinHex | UuEncode | 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>] [-WindowsEmailAddress <SmtpAddress>]
Set-MailContact [-AcceptMessagesOnlyFrom <RecipientIdParameter[]>] [-AcceptMessagesOnlyFromDLMembers <RecipientIdParameter[]>] [-Alias <String>] [-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>] [-Instance <MailContact>] [-MacAttachmentFormat <BinHex | UuEncode | 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>] [-WindowsEmailAddress <SmtpAddress>]
详细说明
通过指定要修改的 Active Directory 中现有已启用邮件的联系人的标识和属性,Set-MailContact cmdlet 可以修改此联系人。
若要运行 Set-MailContact cmdlet,必须为您使用的帐户委派下列角色:
- Exchange 收件人管理员角色
 
有关管理 Exchange Server 2007 所需的权限、角色委派以及权利的详细信息,请参阅权限注意事项。
参数
| 参数 | 必需 | 类型 | 说明 | 
|---|---|---|---|
Identity  | 
必需  | 
Microsoft.Exchange.Configuration.Tasks.MailContactIdParameter  | 
Identity 参数接受下列值之一: 
  | 
AcceptMessagesOnlyFrom  | 
可选  | 
Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter[]  | 
AcceptMessagesOnlyFrom 参数指定可以将电子邮件发送给此邮件联系人的收件人。它可以接受以下任何一个值代表有效发件人: 
 默认情况下,此参数为空。此默认值使邮件联系人能够接受来自所有收件人的邮件。  | 
AcceptMessagesOnlyFromDLMembers  | 
可选  | 
Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter[]  | 
AcceptMessagesOnlyFromDLMembers 参数指定允许向此邮件联系人发送电子邮件的通讯组。可以使用下列任何一个值来代表允许的通讯组: 
 默认情况下,此参数为空。  | 
Alias  | 
可选  | 
System.String  | 
Alias 参数指定已启用邮件的联系人的别名。别名可以包含字母、数字以及下列标点符号和符号: 
  | 
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 参数指定通讯组列表代理电子邮件地址。  | 
EmailAddressPolicyEnabled  | 
可选  | 
System.Boolean  | 
EmailAddressPolicyEnabled 参数指定是否根据定义的电子邮件地址策略自动更新邮箱的电子邮件地址。  | 
Extensions  | 
可选  | 
Microsoft.Exchange.Data.MultiValuedProperty  | 
此参数指定联系人的一个或多个分机号码。设置了此参数时,拨号计划中的所有分机号码必须是唯一的。  | 
ExternalEmailAddress  | 
可选  | 
Microsoft.Exchange.Data.ProxyAddress  | 
ExternalEmailAddress 参数指定收件人的外部电子邮件地址。  | 
GrantSendOnBehalfTo  | 
可选  | 
Microsoft.Exchange.Configuration.Tasks.MailboxOrMailUserIdParameter[]  | 
GrantSendOnBehalfTo 参数指定可以代表此联系人发送邮件的收件人的可分辨名称 (DN)。  | 
HiddenFromAddressListsEnabled  | 
可选  | 
System.Boolean  | 
HiddenFromAddressListsEnabled 参数指定联系人是否显示在地址列表中。如果值为 $true,联系人将不在地址列表中显示。默认值为 $false。  | 
Instance  | 
可选  | 
Microsoft.Exchange.Data.Directory.Management.MailContact  | 
使用 Instance 参数可以将整个对象传递给此命令以进行处理。该参数主要用于必须将整个对象传递给命令的脚本。  | 
MacAttachmentFormat  | 
可选  | 
Microsoft.Exchange.Data.Directory.Recipient.MacAttachmentFormat  | 
MacAttachmentFormat 参数指定要发送到邮件联系人的邮件的 Apple Macintosh 操作系统附件格式。此参数的有效值是: 
 默认情况下,此参数设置为 BinHex。 MacAttachmentFormat 参数可接受的值取决于 MessageFormat 参数。如果 MessageFormat 参数设置为 Text,则只能将 BinHex 或 UUENCODE 用作此参数的值。如果 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 参数指定要发送到邮件联系人的邮件的邮件正文格式。此参数的有效值是: 
 默认情况下,此参数设置为 TextAndHtml。 MessageFormat 和 MessageBodyFormat 参数相互依赖。如果 MessageFormat 参数设置为 Mime,MessageBodyFormat 参数可以设置为任意有效值。但是,如果 MessageFormat 参数设置为 Text,MessageBodyFormat 参数只能设置为 Text。因此,如果要将此参数设置为 Html 或 TextAndHtml,就必须将 MessageFormat 参数设置为 Mime。  | 
MessageFormat  | 
可选  | 
Microsoft.Exchange.Data.Directory.Recipient.MessageFormat  | 
MessageFormat 参数指定发送到邮件联系人的邮件的邮件正文格式。 此参数的有效值是: 
 默认情况下,此参数设置为 Mime。 MessageFormat 和 MessageBodyFormat 参数相互依赖。如果 MessageFormat 参数设置为 Mime,MessageBodyFormat 参数可以设置为任意有效值。但是,如果 MessageFormat 参数设置为 Text,MessageBodyFormat 参数只能设置为 Text。因此,如果要将 MessageFormat 参数从 Mime 更改为 Text,就必须将 MessageBodyFormat 参数更改为 Text。  | 
Name  | 
可选  | 
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,则可以用为邮件联系人配置的邮件格式设置覆盖全局设置。  | 
WindowsEmailAddress  | 
可选  | 
Microsoft.Exchange.Data.SmtpAddress  | 
WindowsEmailAddress 参数指定此邮箱的 Windows 电子邮件地址。Exchange 不使用此地址。  | 
输入类型
返回类型
错误
| 错误 | 说明 | 
|---|---|
  | 
异常
| 异常 | 说明 | 
|---|---|
  | 
示例
在本示例中,Set-MailContact 命令用于将 John Peoples 的外部电子邮件地址设置为 john@contoso.com。
Set-MailContact -Identity "John Peoples" -ExternalEmailAddress "john@contoso.com"