【问题标题】:How to assign a schema extension to all queried users using Microsoft Graph API?如何使用 Microsoft Graph API 为所有查询的用户分配架构扩展?
【发布时间】:2021-02-03 12:33:52
【问题描述】:

我正在尝试使用下面的查询将我创建的扩展分配给某些用户实例。

https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses/any(x:x/skuId eq c42b9cae-ea4f-4ab7-9717-81576235ccac)&$count=true

在标题上,我将“ConsistencyLevel”指定为“最终”。 Graph Explorer Link.

我收到以下错误。

{
"error": {
    "code": "Request_BadRequest",
    "message": "The following query options are not supported by this request method or cannot be applied to the requested resource: $filter,$expand,$orderby,$count,$inlinecount,$select,$skiptoken,$skip,$top",
    "innerError": {
        "date": "2021-02-03T12:26:57",
        "request-id": "bdb51771-f2e2-4b34-99b0-708150ef5855",
        "client-request-id": "988d5bc5-c549-9147-b02d-4919e5c128c4"
    }
}

}

我有什么方法可以使用我现有的查询为用户分配架构扩展?如果这是可能的,我如何使用 ms-graph-sdk 在 Graph Explorer 和 Java 中实现它?

【问题讨论】:

    标签: azure-active-directory microsoft-graph-api microsoft-graph-sdks


    【解决方案1】:

    当我在问题中打开你的链接时,我得到了如下截图所示的页面,将请求方法更改为“GET”后,我可以成功得到响应。

    对了,我发现一个document 说'注意:OData 4.0 只支持 GET 操作中的系统查询选项。'

    ==================更新=====================

    我假设你想为特定用户添加属性,这里你需要使用update user api,但我发现我无法实现。在 API 文档中,它提到请求正文包含在某些特定属性中。

    【讨论】:

    • 有没有办法使用graph api为某些用户分配扩展?
    • 您需要对所有用户一一打补丁。如果有帮助,您可以使用批处理端点成组运行它们。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多