gpt4 book ai didi

azure - Get-AzureADServiceAppRoleAssignment 不会返回代表其他租户中 AAD 应用程序的 SP 的角色分配

转载 作者:行者123 更新时间:2023-12-03 03:45:53 25 4
gpt4 key购买 nike

有没有办法将所有服务主体的所有角色分配到我的应用程序注册应用程序?我只收到来 self 的房客的信息。

说明:

  • 我有2 位租户:AB
  • 我的应用注册应用位于租户 A
  • 租户 A 中的应用注册对我的应用注册应用进行了角色分配。但租户 A 中也有服务主体,代表租户 B 中的应用注册,该租户 B 具有对我的应用的角色分配

当我 Connect-AzureAD 到租户 A 并运行时:

$myAppServicePrincipal = Get-AzureADServicePrincipal -Filter "AppId eq '$myAppRegisterationAppId'"

Get-AzureADServiceAppRoleAssignment -ObjectId $myAppServicePrincipal.ObjectId

获得我的主租户中的应用注册的服务主体 - A。我没有看到任何代表其他租户中的其他应用注册应用的服务主体。

(我也尝试在租户 B 中运行此命令,但它在那里找不到我的应用程序注册应用程序,这非常明显)

最佳答案

我已经在我的环境中进行了测试。

服务主体的对象 ID 从一个租户更改为另一个租户。

enter image description here

enter image description here

(Get-AzureADServicePrincipal -Filter "AppId eq '$myAppRegisterationAppId'").objectid 返回租户 A 中服务主体的对象 ID。

因此,Get-AzureADServiceAppRoleAssignment -ObjectId $myAppServicePrincipal.ObjectId 仅返回租户 A 中 SP 的角色分配。

如果我们连接到租户 A 并运行以下脚本,它将返回租户 A 中 SP 的角色分配。

$myAppServicePrincipal = Get-AzureADServicePrincipal -Filter "AppId eq '$myAppRegisterationAppId'"

Get-AzureADServiceAppRoleAssignment -ObjectId $myAppServicePrincipal.ObjectId

enter image description here

类似地,如果我们连接到租户 B 并运行相同的脚本,它将返回租户 B 中 SP 的角色分配。

enter image description here

关于azure - Get-AzureADServiceAppRoleAssignment 不会返回代表其他租户中 AAD 应用程序的 SP 的角色分配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69243383/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com