New-ManagementRoleAssignment

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

使用 New-ManagementRoleAssignment cmdlet 可以将管理角色分配给管理角色组、管理角色分配策略、用户或通用安全组 (USG)。

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

语法

App

New-ManagementRoleAssignment
    [[-Name] <String>]
    -Role <RoleIdParameter>
    -App <ServicePrincipalIdParameter>
    [-CustomResourceScope <ManagementScopeIdParameter>]
    [-Confirm]
    [-Delegating]
    [-Force]
    [-RecipientAdministrativeUnitScope <AdministrativeUnitIdParameter>]
    [-RecipientGroupScope <GroupIdParameter>]
    [-WhatIf]
    [<CommonParameters>]

Computer

New-ManagementRoleAssignment
    [[-Name] <String>]
    -Computer <ComputerIdParameter>
    -Role <RoleIdParameter>
    [-Confirm]
    [-CustomConfigWriteScope <ManagementScopeIdParameter>]
    [-CustomRecipientWriteScope <ManagementScopeIdParameter>]
    [-DomainController <Fqdn>]
    [-ExclusiveConfigWriteScope <ManagementScopeIdParameter>]
    [-ExclusiveRecipientWriteScope <ManagementScopeIdParameter>]
    [-Force]
    [-RecipientAdministrativeUnitScope <AdministrativeUnitIdParameter>]
    [-RecipientGroupScope <GroupIdParameter>]
    [-RecipientOrganizationalUnitScope <OrganizationalUnitIdParameter>]
    [-RecipientRelativeWriteScope <RecipientWriteScopeType>]
    [-UnScopedTopLevel]
    [-WhatIf]
    [<CommonParameters>]

Policy

New-ManagementRoleAssignment
    [[-Name] <String>]
    -Policy <MailboxPolicyIdParameter>
    -Role <RoleIdParameter>
    [-Confirm]
    [-CustomConfigWriteScope <ManagementScopeIdParameter>]
    [-CustomRecipientWriteScope <ManagementScopeIdParameter>]
    [-DomainController <Fqdn>]
    [-ExclusiveConfigWriteScope <ManagementScopeIdParameter>]
    [-ExclusiveRecipientWriteScope <ManagementScopeIdParameter>]
    [-Force]
    [-RecipientAdministrativeUnitScope <AdministrativeUnitIdParameter>]
    [-RecipientGroupScope <GroupIdParameter>]
    [-RecipientOrganizationalUnitScope <OrganizationalUnitIdParameter>]
    [-RecipientRelativeWriteScope <RecipientWriteScopeType>]
    [-UnScopedTopLevel]
    [-WhatIf]
    [<CommonParameters>]

SecurityGroup

New-ManagementRoleAssignment
    [[-Name] <String>]
    -Role <RoleIdParameter>
    -SecurityGroup <SecurityGroupIdParameter>
    [-Delegating]
    [-Confirm]
    [-CustomConfigWriteScope <ManagementScopeIdParameter>]
    [-CustomRecipientWriteScope <ManagementScopeIdParameter>]
    [-DomainController <Fqdn>]
    [-ExclusiveConfigWriteScope <ManagementScopeIdParameter>]
    [-ExclusiveRecipientWriteScope <ManagementScopeIdParameter>]
    [-Force]
    [-RecipientAdministrativeUnitScope <AdministrativeUnitIdParameter>]
    [-RecipientGroupScope <GroupIdParameter>]
    [-RecipientOrganizationalUnitScope <OrganizationalUnitIdParameter>]
    [-RecipientRelativeWriteScope <RecipientWriteScopeType>]
    [-UnScopedTopLevel]
    [-WhatIf]
    [<CommonParameters>]

User

New-ManagementRoleAssignment
    [[-Name] <String>]
    -Role <RoleIdParameter>
    -User <UserIdParameter>
    [-Delegating]
    [-Confirm]
    [-CustomConfigWriteScope <ManagementScopeIdParameter>]
    [-CustomRecipientWriteScope <ManagementScopeIdParameter>]
    [-DomainController <Fqdn>]
    [-ExclusiveConfigWriteScope <ManagementScopeIdParameter>]
    [-ExclusiveRecipientWriteScope <ManagementScopeIdParameter>]
    [-Force]
    [-RecipientAdministrativeUnitScope <AdministrativeUnitIdParameter>]
    [-RecipientGroupScope <GroupIdParameter>]
    [-RecipientOrganizationalUnitScope <OrganizationalUnitIdParameter>]
    [-RecipientRelativeWriteScope <RecipientWriteScopeType>]
    [-UnScopedTopLevel]
    [-WhatIf]
    [<CommonParameters>]

说明

添加新角色分配时,可以指定一个使用 New-ManagementRole cmdlet 创建的内置或自定义角色,并指定组织单位 (OU) 或者预定义或自定义的管理作用域以限制分配。

可以使用 New-ManagementScope cmdlet 创建自定义管理作用域,并使用 Get-ManagementScope cmdlet 查看现有作用域的列表。 如果选择不指定 OU,或者预定义或自定义的作用域,则角色的隐式写入作用域将应用于角色分配。

有关管理角色分配的详细信息,请参阅了解管理角色分配

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

示例

示例 1

New-ManagementRoleAssignment -Role "Mail Recipients" -SecurityGroup "Tier 2 Help Desk"

本示例将 Mail Recipients 角色分配给 Tier 2 Help Desk 角色组。

示例 2

Get-ManagementRole "MyVoiceMail" | Format-Table Name, IsEndUserRole

New-ManagementRoleAssignment -Role "MyVoiceMail" -Policy "Sales end-users"

本示例将 MyVoiceMail 角色分配给“Sales end-users”角色分配策略。 首先,验证 MyVoiceMail 角色上的 IsEndUserRole 属性以确保其设置为 $true,表明它是最终用户角色。

在角色被验证为最终用户角色后,将该角色分配给“销售最终用户”角色分配策略。

示例 3

New-ManagementRoleAssignment -Role "Eng Help Desk" -SecurityGroup "Eng HD Personnel" -RecipientOrganizationalUnitScope contoso.com/Engineering/Users

本示例将 Eng Help Desk 角色分配给 Eng HD Personnel 角色组。 此分配将角色的收件人写入作用域限制为 contoso.com/Engineering/Users OU。 作为 Eng HD Personnel 角色组成员的用户只能创建、修改或删除该 OU 中包含的对象。

示例 4

New-ManagementRoleAssignment -Role "Distribution Groups" -SecurityGroup "North America Exec Assistants" -CustomRecipientWriteScope "North America Recipients"

本示例将 Distribution Groups 角色分配给 North America Exec Assistants 角色组。 此分配将角色的收件人写入作用域限制为在 North America Exec Assistants 自定义收件人管理作用域中指定的作用域。 作为 North America Exec Assistants 角色组成员的用户只能创建、修改或删除与指定的自定义收件人管理作用域匹配的通讯组对象。

示例 5

New-ManagementRoleAssignment -Name "Exchange Servers_John" -Role "Exchange Servers" -User John -CustomConfigWriteScope "Sydney Servers"

此示例将 Exchange Server 角色分配给 John。 由于 John 应仅管理位于悉尼的运行 Exchange 的服务器,因此角色分配将角色的配置写入范围限制为悉尼服务器自定义配置角色组中指定的范围。 John 只能管理与指定的自定义配置管理作用域匹配的服务器。

示例 6

New-ManagementRoleAssignment -Name "Excl-Mail Recipients_Executive Administrators" -Role "Mail Recipients" -SecurityGroup "Executive Administrators" -ExclusiveRecipientWriteScope "Exclusive-Executive Recipients"

本示例将 Mail Recipients 角色分配给 Executive Administrators 角色组。 此分配将角色的收件人写入作用域限制为在 Exclusive-Executive Recipients 独占收件人管理作用域中指定的作用域。 因为 Exclusive-Executive Recipients 作用域是独占作用域,所以只有 Executive Administrators 的用户才能管理与独占收件人作用域匹配的行政收件人。 其他任何用户都不能修改行政收件人,除非他们所获得的分配也使用了与相同用户匹配的独占作用域。

示例 7

New-ManagementRoleAssignment -Name "Mail Recipients_Contoso Seattle" -Role "Mail Recipients" -SecurityGroup "Contoso Sub - Seattle" -CustomConfigWriteScope "Contoso Databases" -RecipientOrganizationalUnitScope adatum.com/Contoso/Seattle/Users

本示例将 Mail Recipients 角色分配给 Contoso Sub - Seattle 角色组。 应只允许此角色组中的管理员在特定数据库中创建和管理邮件收件人,而该特定数据库分配给 Contoso 子公司 A. Datum Corporation (adatum.com) 供其使用。 此外,应只允许此组管理员管理西雅图办事处的 Contoso 员工。 为此,创建具有数据库范围的角色分配,将邮件收件人的管理限制为仅数据库范围内的数据库和收件人 OU 范围中的数据库,以限制对 Contoso Seattle OU 内收件人对象的访问。

参数

-App

适用:Exchange Online,用于本地邮箱的内置安全加载项

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

App 参数指定要向其分配管理角色的服务主体。 具体来说,来自 Get-ServicePrincipal cmdlet 输出的 ObjectId GUID 值 (例如 6233fba6-0198-4277-892f-9275bf728bcc) 。

有关服务主体的详细信息,请参阅 Microsoft Entra ID 中的应用程序和服务主体对象

不能将此参数与 SecurityGroup、Policy 或 User cmdlet 一起使用。

参数属性

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

参数集

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

-Computer

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

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

Computer 参数指定为其分配管理角色的计算机名称。

不能将此参数与 SecurityGroup、User 或 Policy 参数一起使用。

参数属性

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

参数集

Computer
Position:Named
必需:True
来自管道的值: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,在不带值的情况下指定“确认”开关会引入一个暂停,从而强制你在继续之前确认命令。

参数属性

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

参数集

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

-CustomConfigWriteScope

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

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

CustomConfigWriteScope 参数指定要与此管理角色分配关联的现有配置作用域。 如果使用 CustomConfigWriteScope 参数,则不能使用 ExclusiveConfigWriteScope 参数。 如果管理范围名称中包含空格,则必须使用引号 (") 括住名称。

参数属性

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

参数集

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

-CustomRecipientWriteScope

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online、本地内置安全加载项邮箱

CustomRecipientWriteScope 参数指定基于收件人的现有管理作用域,将与此管理角色分配相关联。 如果管理范围名称中包含空格,则必须使用引号 (") 括住名称。 如果使用 CustomRecipientWriteScope 参数,则不能使用 RecipientOrganizationalUnitScope 或 ExclusiveRecipientWriteScope 参数。

参数属性

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

参数集

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

-CustomResourceScope

适用:Exchange Online,用于本地邮箱的内置安全加载项

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

CustomResourceScope 参数指定要与此管理角色分配关联的自定义管理范围。 可以使用唯一标识管理范围的任何值。 例如:

  • 名称
  • 可分辨名称 (DN)
  • GUID

如果值中有空格,请使用双引号 (") 将此值括起来。

将此参数与 App 参数配合使用,以向服务主体分配权限。 有关详细信息,请参阅 有关服务主体的详细信息,请参阅 Microsoft Entra ID 中的应用程序和服务主体对象

参数属性

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

参数集

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

-Delegating

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online、本地内置安全加载项邮箱

委派开关指定分配给该角色的用户或 USG 是否可以将该角色委派给其他用户或组。 不必为此开关指定值。

参数属性

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

参数集

SecurityGroup
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
User
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
App
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

参数集

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

-ExclusiveConfigWriteScope

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

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

ExclusiveConfigWriteScope 参数指定要与新角色分配关联的基于配置的独占管理作用域。 如果使用 ExclusiveConfigWriteScope 参数,则不能使用 CustomConfigWriteScope 参数。 如果范围名称中包含空格,则必须使用引号 (") 括住名称。

参数属性

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

参数集

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

-ExclusiveRecipientWriteScope

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online、本地内置安全加载项邮箱

ExclusiveRecipientWriteScope 参数指定要与新角色分配关联的基于收件人的独占管理作用域。 如果使用 ExclusiveRecipientWriteScope 参数,则不能使用 CustomRecipientWriteScope 或 RecipientOrganizationalUnitScope 参数。 如果范围名称中包含空格,则必须使用引号 (") 括住名称。

参数属性

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

参数集

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

-Force

适用:Exchange Online,用于本地邮箱的内置安全加载项

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

Force 开关会隐藏警告或确认消息。 不必为此开关指定值。

您可以在以编程方式运行任务时使用此开关,因为此时并不适合提示用户提供管理输入。

参数属性

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

参数集

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

-Name

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online、本地内置安全加载项邮箱

Name 参数指定新管理角色分配的名称。 此名称的最大长度为 64 个字符。 如果管理角色分配名称包含空格,则使用引号 (") 括住该名称。 如果未指定名称,将自动创建名称。

参数属性

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

参数集

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

-Policy

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online、本地内置安全加载项邮箱

Policy 参数指定要为其分配管理角色的管理角色分配策略的名称。 如果值中有空格,请使用双引号 (") 将此值括起来。

使用 Role 参数指定的角色的 IsEndUserRole 属性必须设置为 $true。

不能将此参数与 App、SecurityGroup、Computer 或 User 参数一起使用。

参数属性

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

参数集

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

-RecipientAdministrativeUnitScope

适用:Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online、本地邮箱的内置安全加载项

此参数仅在基于云的服务中有效。

RecipientAdministrativeUnitScope 参数指定要将新角色分配限定到的管理单元。

管理单元是资源的 Microsoft Entra 容器。 可以使用 Get-AdministrativeUnit cmdlet 查看可用的管理单元。

参数属性

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

参数集

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

-RecipientGroupScope

适用:Exchange Online,用于本地邮箱的内置安全加载项

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

RecipientGroupScope 参数指定要考虑确定角色分配范围的组。 指定组的各个成员 (非嵌套组) 被视为分配范围内。 可以使用唯一标识组的任何值:Name、DistinguishedName、GUID 或 DisplayName。

参数属性

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

参数集

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

-RecipientOrganizationalUnitScope

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online、本地内置安全加载项邮箱

RecipientOrganizationalUnitScope 参数指定 OU,以便将新的角色分配包含在作用域范围内。 如果使用 RecipientOrganizationalUnitScope 参数,则不能使用 CustomRecipientWriteScope 或 ExclusiveRecipientWriteScope 参数。 要指定 OU,请使用以下语法:domain/ou。 如果 OU 名称中包含空格,则使用引号 (") 括住该域和 OU。

参数属性

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

参数集

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

-RecipientRelativeWriteScope

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online、本地内置安全加载项邮箱

RecipientRelativeWriteScope 参数指定应用于收件人作用域的限制类型。 可用类型是 None、Organization、MyGAL、Self 和 MyDistributionGroups。 使用 CustomRecipientWriteScope 或 RecipientOrganizationalUnitScope 参数时,系统将自动设置 RecipientRelativeWriteScope 参数。

即使 NotApplicable、OU、MyDirectReports、CustomRecipientScope、MyExecutive、MailboxICanDelegate 和 ExclusiveRecipientScope 值出现在此参数的语法块中,也不能直接在命令行上使用它们。 它们供 cmdlet 内部使用。

参数属性

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

参数集

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

-Role

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online、本地内置安全加载项邮箱

Role 参数指定要分配的现有角色。 可以使用唯一标识角色的任何值。 例如:

  • 名称
  • 可分辨名称 (DN)
  • GUID

如果值中有空格,请使用双引号 (") 将此值括起来。

如果使用 App 参数,则无法指定用户角色;只能指定应用程序或管理角色。

参数属性

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

参数集

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

-SecurityGroup

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online、本地内置安全加载项邮箱

SecurityGroup 参数指定要向其分配管理角色的管理角色组或启用邮件的通用安全组的名称。 如果值中有空格,请使用双引号 (") 将此值括起来。

不能将此参数与应用、策略、计算机或用户参数一起使用。

参数属性

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

参数集

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

-UnScopedTopLevel

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

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

默认情况下,此参数仅在无范围角色管理角色中可用,并且该角色未分配给任何角色组。 若要使用此参数,需要将“无范围角色管理”角色添加到角色组 (例如,添加到“组织管理”角色组) 。 有关详细信息,请参阅向角色组添加角色

UnScopedTopLevel 开关指定随 Role 参数提供的角色是无作用域的顶级管理角色。 不必为此开关指定值。

无范围的顶级管理角色只能包含自定义脚本或非 Exchange cmdlet。 有关详细信息,请参阅 创建无作用域角色

参数属性

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

参数集

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

-User

适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE、Exchange Online、本地内置安全加载项邮箱

User 参数指定要向其分配管理角色的用户。

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

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

不能将此参数与应用、安全组、计算机或策略参数一起使用。

参数属性

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

参数集

User
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
别名:WI

参数集

(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 不返回任何数据。