Set-MailUser

 

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

上一次修改主题: 2010-10-21

使用 Set-MailUser cmdlet 可以修改 Active Directory 目录服务中现有用户与邮件相关的属性。

语法

set-MailUser -Identity <MailUserIdParameter> [-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>] [-MaxSendSize <Unlimited>] [-MessageBodyFormat <Text | Html | TextAndHtml>] [-MessageFormat <Text | Mime>] [-Name <String>] [-PrimarySmtpAddress <SmtpAddress>] [-RecipientLimits <Unlimited>] [-RejectMessagesFrom <RecipientIdParameter[]>] [-RejectMessagesFromDLMembers <RecipientIdParameter[]>] [-RequireSenderAuthenticationEnabled <$true | $false>] [-SamAccountName <String>] [-SecondaryAddress <String>] [-SecondaryDialPlan <UMDialPlanIdParameter>] [-SimpleDisplayName <String>] [-UMDtmfMap <MultiValuedProperty>] [-UseMapiRichTextFormat <Never | Always | UseDefaultSettings>] [-UsePreferMessageFormat <$true | $false>] [-UserPrincipalName <String>] [-UseRusServer <String>] [-WhatIf [<SwitchParameter>]] [-WindowsEmailAddress <SmtpAddress>]

set-MailUser [-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 <MailUser>] [-MacAttachmentFormat <BinHex | AppleSingle | AppleDouble>] [-MaxReceiveSize <Unlimited>] [-MaxSendSize <Unlimited>] [-MessageBodyFormat <Text | Html | TextAndHtml>] [-MessageFormat <Text | Mime>] [-Name <String>] [-PrimarySmtpAddress <SmtpAddress>] [-RecipientLimits <Unlimited>] [-RejectMessagesFrom <RecipientIdParameter[]>] [-RejectMessagesFromDLMembers <RecipientIdParameter[]>] [-RequireSenderAuthenticationEnabled <$true | $false>] [-SamAccountName <String>] [-SecondaryAddress <String>] [-SecondaryDialPlan <UMDialPlanIdParameter>] [-SimpleDisplayName <String>] [-UMDtmfMap <MultiValuedProperty>] [-UseMapiRichTextFormat <Never | Always | UseDefaultSettings>] [-UsePreferMessageFormat <$true | $false>] [-UserPrincipalName <String>] [-UseRusServer <String>] [-WhatIf [<SwitchParameter>]] [-WindowsEmailAddress <SmtpAddress>]

详细说明

使用 Set-MailUser cmdlet 可以修改 Active Directory 中已启用邮件的用户与邮件相关的属性。

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

  • Exchange 收件人管理员角色

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

note注意:
并非所有用户属性都可以使用 Set-MailUser cmdlet 进行修改。可以使用 Set-User cmdlet 设置与邮件无关的其他用户属性。

参数

参数 必需 类型 说明

Identity

必需

Microsoft.Exchange.Configuration.Tasks.MailUserIdParameter

Identity 参数接受以下值之一:

  • ADObjectID

  • GUID

  • 可分辨名称 (DN)

  • 域\SAM 帐户名

  • 用户主体名称 (UPN)

  • 旧版 DN

  • 电子邮件地址

  • 用户别名

  • 如果指定了 Instance 参数,则不能使用 Identity 参数。

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 参数指定是否根据定义的电子邮件地址策略自动更新邮箱的电子邮件地址。如果此参数设置为 $true,则不能更改 PrimarySmtpAddress 参数或 WindowsEmailAddress 参数。

Extensions

可选

Microsoft.Exchange.Data.MultiValuedProperty

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

ExternalEmailAddress

可选

Microsoft.Exchange.Data.ProxyAddress

ExternalEmailAddress 参数指定一个组织之外的电子邮件地址。发送到用户的电子邮件被发送到此外部地址。

GrantSendOnBehalfTo

可选

Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter

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

HiddenFromAddressListsEnabled

可选

System.Boolean

HiddenFromAddressListsEnabled 参数指定用户是否显示在地址列表中。默认值为 $false。

IgnoreDefaultScope

可选

System.Management.Automation.SwitchParameter

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

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

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

Instance

可选

Microsoft.Exchange.Data.Directory.Management.MailUser

使用 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。

如果未指定,则没有大小限制。

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 地址。

RecipientLimits

可选

Microsoft.Exchange.Data.Unlimited

RecipientLimits 参数指定此用户的邮件的最大收件人数。

RejectMessagesFrom

可选

Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter[]

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

RejectMessagesFromDLMembers

可选

Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter[]

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

RequireSenderAuthenticationEnabled

可选

System.Boolean

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

SamAccountName

可选

System.String

SamAccountName 参数定义用来支持运行旧版操作系统(例如,Microsoft Windows NT 4.0、Windows 98、Windows 95 和 LAN Manager)的客户端和服务器的登录名。此属性包含的字符必须少于 20 个。帐户名可以使用字母、数字以及下列标点符号和符号:

  • !

  • #

  • $

  • %

  • ^

  • &

  • -

  • .

  • _

  • {

  • }

  • |

  • ~

SecondaryAddress

可选

System.String

此参数指定启用 UM 的用户使用的辅地址。

SecondaryDialPlan

可选

Microsoft.Exchange.Configuration.Tasks.UMDialPlanIdParameter

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

SimpleDisplayName

可选

System.String

如果只允许使用有限的一组字符,则使用 SimpleDisplayName 参数显示对象的备用说明。这组有限的字符由以下字符组成:

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\"()+,-./:?

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,则将用为邮件用户配置的邮件格式设置覆盖任何全局设置。

UserPrincipalName

可选

System.String

UserPrincipalName 参数指定用户的用户主要名称 (UPN)。

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-MailUser 命令来设置已启用邮件的用户 John Peoples 向其发送邮件的组织外部的电子邮件地址。

Set-MailUser john -ExternalEmailAddress john@tailspintoys.com