Add-MailboxPermission

此 cmdlet 可在本地 Exchange 和基于云的服务中使用。 某些参数和设置可能只属于一个环境或另一个环境。

使用 Add-MailboxPermission cmdlet 向邮箱或 Exchange Server 2016、Exchange Server 2019 或Exchange Online邮件用户添加权限。

有关以下语法部分的参数设置的详细信息,请参阅 Exchange cmdlet 语法

语法

AccessRights

Add-MailboxPermission
    [-Identity] <MailboxIdParameter>
    -AccessRights <MailboxRights[]>
    -User <SecurityPrincipalIdParameter>
    [-AutoMapping <Boolean>]
    [-Confirm]
    [-Deny]
    [-DomainController <Fqdn>]
    [-GroupMailbox]
    [-IgnoreDefaultScope]
    [-InheritanceType <ActiveDirectorySecurityInheritance>]
    [-WhatIf]
    [<CommonParameters>]

Owner

Add-MailboxPermission
    [-Identity] <MailboxIdParameter>
    -Owner <SecurityPrincipalIdParameter>
    [-Confirm]
    [-DomainController <Fqdn>]
    [-GroupMailbox]
    [-IgnoreDefaultScope]
    [-WhatIf]
    [<CommonParameters>]

Instance

Add-MailboxPermission
    [[-Identity] <MailboxIdParameter>]
    -Instance <MailboxAcePresentationObject>
    [-AccessRights <MailboxRights[]>]
    [-User <SecurityPrincipalIdParameter>]
    [-AutoMapping <Boolean>]
    [-Confirm]
    [-Deny]
    [-DomainController <Fqdn>]
    [-GroupMailbox]
    [-IgnoreDefaultScope]
    [-InheritanceType <ActiveDirectorySecurityInheritance>]
    [-WhatIf]
    [<CommonParameters>]

说明

注意

可以使用此 cmdlet 向邮箱添加最多 500 个权限条目 (ACE) 。 若要向 500 多个用户授予权限,请使用安全组而不是单个用户作为 User 参数。 安全组包含许多成员,但只计为一个条目。

您必须先获得权限,然后才能运行此 cmdlet。 尽管本文列出了 cmdlet 的所有参数,但如果某些参数未包含在分配给你的权限中,则可能无法访问这些参数。 若要查找在贵组织中运行任何 cmdlet 或参数所需的权限,请参阅 Find the permissions required to run any Exchange cmdlet

示例

示例 1

Add-MailboxPermission -Identity "Terry Adams" -User "Kevin Kelly" -AccessRights FullAccess -InheritanceType All

本示例向用户分配 Kevin Kelly 对 Terry Adams 邮箱的完全访问权限。

示例 2

Add-MailboxPermission -Identity "Room 222" -Owner "Tony Smith"

本示例将用户 Tony Smith 设置为名为 Room 222 的资源邮箱的所有者。

示例 3

Add-MailboxPermission -Identity "Jeroen Cool" -User "Mark Steele" -AccessRights FullAccess -InheritanceType All -AutoMapping $false

本示例为用户 Mark Steele 分配对 Jeroen Cool 邮箱的完全访问权限,防止 Outlook 在 Mark Steele 打开 Outlook 时打开 Jeroen Cool 的邮箱。

示例 4

Get-Mailbox -ResultSize unlimited -Filter "(RecipientTypeDetails -eq 'UserMailbox') -and (Alias -ne 'Admin')" | Add-MailboxPermission -User admin@contoso.com -AccessRights FullAccess -InheritanceType All

在Exchange Online中,此示例将管理员帐户admin@contoso.com的“完全访问权限”分配给 contoso.com 组织中的所有用户邮箱。

参数

-AccessRights

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online

AccessRights 参数指定要为邮箱上的用户添加的权限。 有效值包含:

  • ChangeOwner
  • ChangePermission
  • DeleteItem
  • ExternalAccount
  • FullAccess
  • ReadPermission

可以指定用逗号分隔的多个值。

不能将此参数与 Owner 参数一起使用。

参数属性

类型:

MailboxRights[]

默认值:None
支持通配符:False
不显示:False

参数集

AccessRights
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
Instance
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-AutoMapping

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online

AutoMapping 参数在 Microsoft Outlook 中的自动映射功能中包括或排除邮箱。 如果用户对邮箱具有完全访问权限,则自动映射使用自动发现将邮箱自动添加到用户的 Outlook 配置文件。 但是,自动发现不会枚举对邮箱具有完全访问权限的安全组。 有效值包含:

  • $true:如果用户具有完全访问权限,则邮箱会自动添加到用户的 Outlook 配置文件中。 此值为默认值。
  • $false:如果用户具有“完全访问权限”权限,则邮箱不会自动添加到用户的 Outlook 配置文件中。

注意:若要对已向用户分配有完全访问权限的邮箱禁用自动映射,需要使用 Remove-MailboxPermission cmdlet 删除该用户的完全访问权限,然后使用 AutoMapping 参数重新分配用户对邮箱的完全访问权限,其值$false。

参数属性

类型:Boolean
默认值:$true
支持通配符:False
不显示:False

参数集

AccessRights
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
Instance
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Confirm

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online

Confirm 开关指定是否显示确认提示。 此开关对 cmdlet 造成的影响取决于在你继续操作之前 cmdlet 是否需要确认。

  • 破坏性 cmdlet(例如 Remove-* cmdlets)内置有暂停,可强制要求先确认命令,然后再继续操作。 对于这些 cmdlet,您可以使用此确切语法跳过确认提示:-Confirm:$false
  • 其他大多数 cmdlet(例如 New-* 和 Set-* cmdlet)都没有内置暂停。 对于这些 cmdlet,指定不含值的 Confirm 开关会引入暂停,从而强制要求你先确认命令,然后再继续操作。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:cf

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Deny

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online

“拒绝”开关指定要添加的权限为“拒绝权限”。 不必为此开关指定值。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

AccessRights
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
Instance
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-DomainController

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

此参数只在本地 Exchange 中可用。

DomainController 参数指定此 cmdlet 从 Active Directory 读取数据或向其写入数据时使用的域控制器。 可以使用完全限定的域名 (FQDN) 来标识域控制器。 例如,dc01.contoso.com。

参数属性

类型:Fqdn
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-GroupMailbox

适用:Exchange Online

此参数仅在基于云的服务中可用。

需要 GroupMailbox 开关才能将权限添加到 Microsoft 365 组邮箱。 不必为此开关指定值。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

AccessRights
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
Owner
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
Instance
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Identity

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online

Identity 参数指定要向用户分配权限的邮箱。 可以使用能够唯一标识邮箱的任意值。 例如:

  • 名称
  • 别名
  • 可分辨名称 (DN)
  • 可分辨名称 (DN)
  • 域\用户名
  • 电子邮件地址
  • GUID
  • LegacyExchangeDN
  • SamAccountName
  • 用户 ID 或用户主体名称 (UPN)

参数属性

类型:MailboxIdParameter
默认值:None
支持通配符:False
不显示:False

参数集

AccessRights
Position:1
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False
Owner
Position:1
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False
Instance
Position:1
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

-IgnoreDefaultScope

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online

IgnoreDefaultScope 开关指示命令忽略 Exchange PowerShell 会话的默认收件人范围设置,并将整个林用作范围。 不必为此开关指定值。

此开关使命令能够访问当前在默认范围中不可用的 Active Directory 对象,但也引入了以下限制:

  • 无法使用 DomainController 参数。 此命令自动使用相应的全局编录服务器。
  • 无法使用 DomainController 参数。 此命令自动使用相应的全局编录服务器。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-InheritanceType

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online

InheritType 参数指定邮箱中的文件夹如何继承权限。 有效值包含:

  • None
  • 所有 (这是默认值)
  • Children
  • 后代 [sic]
  • SelfAndChildren

参数属性

类型:ActiveDirectorySecurityInheritance
默认值:All
支持通配符:False
不显示:False

参数集

AccessRights
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
Instance
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Instance

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE

此参数只在本地 Exchange 中可用。

此参数已弃用,不再使用。

参数属性

类型:MailboxAcePresentationObject
默认值:None
支持通配符:False
不显示:False

参数集

Instance
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

-Owner

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online

Owner 参数指定邮箱对象的所有者。 可以为此参数指定以下类型的用户或组 (安全主体) :

  • 邮箱用户
  • 邮件用户
  • 安全组

可以使用任何能够唯一标识该用户或组的值。 例如:

  • 名称
  • 别名
  • 可分辨名称 (DN)
  • 可分辨名称 (DN)
  • 域\用户名
  • 电子邮件地址
  • GUID
  • LegacyExchangeDN
  • SamAccountName
  • 用户 ID 或用户主体名称 (UPN)

默认邮箱所有者为 NT AUTHORITY\SELF。

不能将此参数与 AccessRights 或 User 参数一起使用。

参数属性

类型:SecurityPrincipalIdParameter
默认值:None
支持通配符:False
不显示:False

参数集

Owner
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-User

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online

User 参数指定谁获取邮箱的权限。 可以为此参数指定以下类型的用户或组 (安全主体) :

  • 邮箱用户
  • 邮件用户
  • 启用邮件的安全组 (未启用邮件的安全组是可选的,但它们无法)

注意:当启用邮件的安全组用于指定“完全访问权限”时,自动映射功能不会自动在 Outlook 中为组成员添加邮箱。 有关详细信息,请参阅 帐户具有完全访问权限的邮箱不会自动映射到 Outlook 配置文件

为了获得最佳结果,我们建议使用以下值:

  • UPN:例如, user@contoso.com (用户仅) 。
  • Domain\SamAccountName:例如 contoso\user

否则,可以使用唯一标识用户或组的任何值。 例如:

  • 名称
  • 别名
  • 可分辨名称 (DN)
  • 可分辨名称 (DN)
  • 域\用户名
  • 电子邮件地址
  • GUID
  • LegacyExchangeDN
  • SamAccountName
  • 用户 ID 或用户主体名称 (UPN)

不能将此参数与 Owner 参数一起使用。

参数属性

类型:SecurityPrincipalIdParameter
默认值:None
支持通配符:False
不显示:False

参数集

AccessRights
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
Instance
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WhatIf

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online

WhatIf 开关模拟命令操作。 可以使用此开关在不实际应用将会发生的更改的情况下预览这些更改。 不必为此开关指定值。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:无线

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters

输入

Input types

若要了解此 cmdlet 接受的输入类型,请参阅 cmdlet 的输入和输出类型。 如果 cmdlet 的"输入类型"字段为空,则表明此 cmdlet 不接受输入数据。

输出

Output types

若要了解此 cmdlet 接受的返回类型(亦称为"输出类型"),请参阅 cmdlet 的输入和输出类型。 如果"输出类型"字段为空,则表明此 cmdlet 不返回任何数据。