简体   繁体   English

Azure PowerShell 将用户或组添加到服务主体

[英]Azure PowerShell add User or Group to Service Principal

how can i add users or a group to a service principal in azure with powershell?如何将用户或组添加到 azure 和 powershell 中的服务主体?

My Service Principal:我的服务负责人:

$servicePrincipal = Get-AzADServicePrincipal -DisplayName "My Application"

i want to add the user test@domain.de or the group "IT" to this service principal.我想将用户 test@domain.de 或组“IT”添加到此服务主体。

EDIT: Or the AppRoleAssignmentRequired set to "false" would be fine too.编辑:或者将 AppRoleAssignmentRequired 设置为“false”也可以。

I found the solution how to disable that role assignment is required.我找到了如何禁用该角色分配的解决方案。 I post the solution before i delete the thread.我在删除线程之前发布了解决方案。 Maybe this helps someone.也许这对某人有帮助。

Get-AzureADServicePrincipal -Filter "displayname eq 'My Application'" | set-AzureADServicePrincipal -AppRoleAssignmentRequired $true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM