New-azureadGroupAppRoleasSignment cmdlet使用
我正在尝试弄清楚如何使用powershell cmdlet new-azureadgroupapproleassignment将组添加到应用程序角色中。
在Azuread Portal中,我将选择:企业应用程序> app_name>用户和团体>添加用户/组,然后选择组名和应用程序角色。
当我在下面使用的应用程序,组和应用程序角色在门户网站上执行此操作时,它将成功完成。
我从下面的文档中可以看出的最好的方法是:
New-AzureADGroupAppRoleAssignment -ObjectId $objectId -Id $objectId -PrincipalId $principalId -ResourceId $resourceId
2.0
ObjectId = name of the group being assigned to the app role
Id = not sure here, but some examples point to using the group object ID again
PrincipalId = app object id
ResourceId = app role object id
new-azureadgroupapproleassignment:执行时发生错误 newGroupApproleassignment代码:request_badrequest消息:不是 有效的参考更新。 requestID: FB8145C9-8FB4-4D6D-92B7-F48A8A81EEF1E2D DATETIMESTAMP:THU,07年7月7日 15:27:10 GMT httpstatuscode:BadRequest httpstatusdescription:Bad 请求httpresponsestatus:完成 \ truenas \ it \ scripts \ azuread \ azuread-add app test to to group test.ps1:12 char:1
- new -azureadgroupapproleassignment -objectid $ objectid -id $ id -princi ...
+ categoryInfo:未指定::) [new-azureadgroupapproleassignment],apiexception + flutlqualifiedErrid:microsoft.open.azuread16.client.apiexception,microsoft.open.azuread16.powershell.newgroupapproupproleaseassignment
I am trying to figure out how to use the PowerShell cmdlet New-AzureADGroupAppRoleAssignment to add a group to an app role.
In the AzureAD portal, I would select: enterprise applications > app_name > users and groups > add user/group, then select the group name and the app role.
When I do this in the portal with the app, group, and app role I use below, it completes successfully.
The best way I can tell from the documentation below to run this is something like:
New-AzureADGroupAppRoleAssignment -ObjectId $objectId -Id $objectId -PrincipalId $principalId -ResourceId $resourceId
where:
ObjectId = name of the group being assigned to the app role
Id = not sure here, but some examples point to using the group object ID again
PrincipalId = app object id
ResourceId = app role object id
When I run this, I get the following error:
New-AzureADGroupAppRoleAssignment : Error occurred while executing
NewGroupAppRoleAssignment Code: Request_BadRequest Message: Not a
valid reference update. RequestId:
fb8145c9-8fb4-4d6d-92b7-f48a81ef1e2d DateTimeStamp: Thu, 07 Jul 2022
15:27:10 GMT HttpStatusCode: BadRequest HttpStatusDescription: Bad
Request HttpResponseStatus: Completed At
\truenas\IT\Scripts\AzureAD\AzureAD-Add App Role to Group Test.ps1:12
char:1
- New-AzureADGroupAppRoleAssignment -ObjectId $objectId -Id $id -Princi ...
+ CategoryInfo : NotSpecified: (:) [New-AzureADGroupAppRoleAssignment], ApiException + FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.NewGroupAppRoleAssignment
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些是
new-azureadgroupapproleassignment
中的参数的正确值These are the correct values to use for the parameters in
New-AzureADGroupAppRoleAssignment