Azure:是否可以通过Node JS / Power Shell脚本将用户分配给企业应用程序?

时间:2019-01-11 13:24:43

标签: azure azure-active-directory

如何获取分配给Azure企业应用程序的所有用户的列表?

我查看了Azure文档,但无法获取任何API来解决此问题。

1 个答案:

答案 0 :(得分:1)

您可以像这样通过Powershell获取Azure企业应用程序的所有用户帐户:

$app_name = "[app display name]"
$sp = Get-AzureADServicePrincipal -Filter "displayName eq '$app_name'"
$assignments = Get-AzureADServiceAppRoleAssignment -ObjectId $sp.ObjectId -All $true
$assignments  # this will show all the users associated to the principal

它会像这样:

enter image description here

希望这会对您有所帮助。还有其他问题,请给我消息。