以编程方式从Azure AD获取用户组和角色 [英] Programatically get users group and role from Azure AD

查看:515
本文介绍了以编程方式从Azure AD获取用户组和角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是azure AD的新手。

I am new to azure AD.


我有第三方API,它给了我一个userId。我编写了一个.netcore API,它应该使用此userID并获取该特定用户的角色和组。

I have a third party API which gives me a userId. I have written a .netcore API which should take this userID and get the roles and group of that specific user.


我已阅读有关微软图API的信息。不确定这在我的场景中是否有用。

I have read about the microsoft graph API. Not sure if this is useful in my scenario.


还有其他任何方式以编程方式访问AD用户的角色和组。

Also is there any other way to access the roles and groups of a AD user programatically.

推荐答案

是的,Graph API可以通过/ memberof端点为您提供该信息:
https://docs.microsoft.com/en-us/graph/api/user-list- memberof?view = graph-rest-1.0

或者您可以使用PowerShell,Get-MsolUserRole或Get-AzureADUserMembership。

Or you can use PowerShell, Get-MsolUserRole or Get-AzureADUserMembership.


这篇关于以编程方式从Azure AD获取用户组和角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆