大网数据广告活动
域与目录服务

Microsoft Graph API MemberOf Returns Null Values for Properties

· 52CE 我爱测

Provides a solution to an issue where some properties are indicated as null when you call the Microsoft Graph API memberOf.

This article provides a solution to an issue where some properties are indicated as null when you call the Microsoft Graph API memberOf.

Symptoms

When calling one of the following APIs that can return the list of groups and directory roles that a user is a direct member of, you see null values for all properties except the object type and ID in the JSON response:

GET https://graph.microsoft.com/v1.0/me/memberOf
GET https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/memberOf

Here's a sample JSON response:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects",
    "value": [
        {
            "@odata.type": "#microsoft.graph.group",
            "id": "00000003-0000-0000-c000-000000000000",
            "deletedDateTime": null,
            "classification": null,
            "createdDateTime": null,
            "creationOptions": [],
            "description": null,
            "displayName": null,
            "expirationDateTime": null,
            "groupTypes": [],
            "isAssignableToRole": null,
            "mail": null,
            "mailEnabled": null,
            "mailNickname": null,
            "membershipRule": null,
            "membershipRuleProcessingState": null
        }
    ]
}

Cause

When an application queries the membership that returns a directoryObject type collection, if it doesn't have permission to read a resource type, members of that type are returned with limited information. For example, only the object type and ID might be returned, and other properties are indicated as null. Complete information is returned for the object types that the application has permission to read.

For more information, see List a user's direct memberships and Limited information returned for inaccessible member objects.

Solution

To get complete information, configure at least the Directory.Read.All permission for your application.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 04/03/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。