Microsoft-graph api,它提供有关用户角色的信息(用户是否具有管理角色)

问题描述 投票:0回答:1

我正在寻找microsoft-graph api,它提供了有关用户角色(is the user administrator?)的信息。我有用户https://graph.microsoft.com/User.Read.All。它提供以下信息

{
    "businessPhones": [
        "+1 425 555 0109"
    ],
    "displayName": "Adele Vance",
    "givenName": "Adele",
    "jobTitle": "Retail Manager",
    "mail": "[email protected]",
    "mobilePhone": null,
    "officeLocation": "18/2111",
    "preferredLanguage": "en-US",
    "surname": "Vance",
    "userPrincipalName": "[email protected]",
    "id": "cccccccc-cccc-aaaa-bbbb-dddddddddddd"
}  

更新1:单个API可以返回组织名称,具有分配角色并可以访问特定应用程序/加载项的用户。如果不是,则要获取上述信息的API是什么。

我如何确定用户属于工作/学校帐户([email protected])还是属于个人帐户([email protected])。

azure-active-directory microsoft-graph azure-ad-graph-api
1个回答
0
投票

使用GET https://graph.microsoft.com/v1.0/users/user id/memberOf获取用户直接所属的组和目录角色。

如果该帐户是普通用户,则结果中将没有directoryRole。

如果该帐户具有任何directoryRole,它将显示在结果中。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.