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

Can't Look Up Users Using Microsoft Graph /Users Endpoint

· 52CE 我爱测

Provides a solution to an issue where a user can't look up other users using the Microsoft Graph /users endpoint when a tenant policy configuration restricts access.

You can use the Microsoft Graph endpoint to interact programmatically with your tenant data. A common scenario is to use a Microsoft Graph /users endpoint to look up users in the tenant. In this case, if you use delegated permissions in your access token, the User.Read.All permission is necessary. There are ways to prevent you from looking up other users, such as using an authorizationPolicy object that can control Microsoft Entra authorization settings, unless you're a tenant administrator.

This article provides a solution to an issue where you can't look up other users using the Microsoft Graph /users endpoint after a tenant policy configuration restricts access to other users.

Symptoms

After you enable an authorizationPolicy object in your tenant to prevent the user lookup action, a new application receives a 401 HTTP response when it performs this action. This issue occurs even though the proper permissions are consented to during app registration and the access token has the proper permissions.

Cause

The allowedToReadOtherUser property in the authorizationPolicy is set to false. This setting prevents the default user role from reading other users. You can check its value via a GET request:

GET https://graph.microsoft.com/v1.0/policies/authorizationPolicy

Solution

To resolve this issue, set the value of the allowedToReadOtherUser property to true via a PATCH request as follows:

PATCH https://graph.microsoft.com/v1.0/policies/authorizationPolicy
{
    "defaultUserRolePermissions": {
    "allowedToReadOtherUsers": true
    }
}

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/30/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

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

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