sharepoint - 无法从 Azure AD 导入的用户获取用户属性

标签 sharepoint azure-active-directory microsoft-graph-api sharepoint-online

我正在使用 Graph 来获取我的 sharepoint 在线站点上的所有用户。除了一个例子外,代码工作得很好。

我已经从 azure 广告同步了 sharepoint 用户,然后我无法获取用户的属性。

这是 webApiPermissionRequests:

"webApiPermissionRequests": [
      {
        "resource": "Microsoft Graph",
        "scope": "User.ReadBasic.All"
      },
      {
        "resource": "Microsoft Graph",
        "scope": "Contacts.Read"
      },
      {
        "resource": "Microsoft Graph",
        "scope": "User.Read.All"
      }
    ]

我获取用户的请求:
const users: MSGraphClient = this.context.serviceScope.consume(MSGraphClient.serviceKey);
users
  .api("/users")
  .select("displayName,mobilePhone,mail,photo,department,jobTitle,mailNickname")
  .top(999)
  .get((error, response: any, rawResponse?: any) => {

正如我所说,当用户从 Azure AD 导入时,一切正常。

谁能告诉我为什么除了 displayName 之外的所有属性为导入用户时为 null。

更新

我添加了一张图片。我只能通过上面的api获得手机号码(Mobiltelefon)。其余的数据和信息没有被接收。让我们看看 Office (Kontor) 来自 azure add,而不是在 API 中没有收到。

enter image description here

最佳答案

根据您的描述,您想通过 MS Graph API 获取用户的属性。

根据我的测试,我们可以得到属性。对于您的情况,我们应该检查值为 null 的属性。

检查 Azure AD 中的属性是否为空。

关于sharepoint - 无法从 Azure AD 导入的用户获取用户属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52404419/

相关文章:

azure - 如何从外部应用程序管理Azure应用程序角色

microsoft-graph-api - 使用Microsoft Graph在用户上获取扩展属性

office365 - Microsoft Graph API : Get all rules for mail account

sharepoint - 尝试使用SharePoint 2013集成创建新团队项目时出现TFS 2013错误TF218017

Sharepoint:从计时器作业执行 stsadm + SHAREPOINT\System 权限

javascript - 从 jQuery-ajax 到 Breeze.js(SharePoint ODATA 示例)

azure - 资源所有者密码凭据 token 在 Azure Function App 上导致 401

java - 使用 Apache HttpClient 和负载平衡的 SharePoint REST 调用在首次 GET 后失败

azure - 如何使用或访问Azure AD公开的API(MyApis)?

microsoft-graph-api - 架构扩展 : "Unsupported or invalid query filter clause specified for property ' companyName' of resource 'User' .“