当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 获取 MsolScopedRoleMember

作者:精品下载站 日期:2024-12-14 06:26:47 浏览:12 分类:玩电脑

获取 MsolScopedRoleMember


PowerShell 中的 Get-MsolScopedRoleMember 命令可获取通过 Microsoft Office 365 中的管理单位授予该角色的角色成员。

下面给出了获取管理单元范围内指定角色的成员的语法。

Get-MsolScopedRoleMember
   [-AdministrativeUnitObjectId <Guid>]
   [-RoleObjectId <Guid>]
   [-MaxResults <Int32>]
   [-TenantId <Guid>]
   [<CommonParameters>]
   [-All]

在本文中,我们将讨论如何在 PowerShell 中使用 Get-MsolScopedRoleMember cmdlet 获取 Office 365 中管理单位范围内指定角色的成员。

如何在 Office 365 中获取用户管理员角色的成员

若要获取 Office 365 中用户管理员角色的成员,请使用 Get-MsolScopedRoleMember cmdlet 以及 -RoleObjectId-AdministrativeUnitObjectId 参数。

-RoleObjectId 参数指定从中获取成员的角色的唯一对象 ID,-AdministrativeUnitObjectId 参数指定管理单元的唯一对象 ID。

# Get the East Coast Administrative unit
$eastcoastAU = Get-MsolAdministrativeUnit -SearchString "East Coast"   

# Get the user belongs to User Administrator Role
$UserAdmin = Get-MsolRole -RoleName "User Administrator"   

# Get members of the User Administrator role that is scoped to the administrative unit
Get-MsolScopedRoleMember -RoleObjectId $UserAdmin.ObjectId -AdministrativeUnitObjectId $eastcoastAU.ObjectId 

此命令获取“用户管理员”角色的所有成员,该角色的范围为名为“东海岸”的管理单元。

结论

我希望上述有关如何在 PowerShell 中使用 Get-MsolScopedRoleMember cmdlet 获取通过管理单位授予该角色的角色成员的文章对您有所帮助。

您可以在 ShellGeek 主页上找到有关 PowerShell Active Directory 命令和 PowerShell 基础知识的更多主题。

相关链接

获取 MsolRole

获取 Msol 管理单位

删除-MsolScopedRoleMember

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯