microsoft-graph-api - Microsoft Graph API - 计算所有拥有许可证的用户
问题描述
我正在尝试查询 Graph 以获取所有具有特定许可证的用户。
我有以下数据: https://graph.microsoft.com/v1.0/users ?$select=id,assignedLicenses
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(id,assignedLicenses)",
"value": [
{
"id": "6e7b768e-07e2-4810-8459-485f84f8f204",
"assignedLicenses": []
},
{
"id": "87d349ed-44d7-43e1-9a83-5f2406dee5bd",
"assignedLicenses": [
{
"disabledPlans": [],
"skuId": "c7df2760-2c81-4ef7-b578-5b5392b571df"
}
]
},
{
"id": "5bde3e51-d13b-4db1-9948-fe4b109d11a7",
"assignedLicenses": [
{
"disabledPlans": [],
"skuId": "90d8b3f8-712e-4f7b-aa1e-62e7ae6cbe96"
},
{
"disabledPlans": [],
"skuId": "725422ed-e205-400e-ab0a-3899d8a398ca"
},
{
"disabledPlans": [],
"skuId": "c7df2760-2c81-4ef7-b578-5b5392b571df"
}
]
}
]
}
我的最终目标是计算拥有此许可证的所有用户:“c7df2760-2c81-4ef7-b578-5b5392b571df”,但作为开始,我试图获取所有这些用户的列表。
但是在拨打电话时: https ://graph.microsoft.com/v1.0/users ?$filter=assignedLicenses/any(a: a/skuId eq 'c7df2760-2c81-4ef7-b578-5b5392b571df')
我收到以下异常:
{
"error": {
"code": "BadRequest",
"message": "Invalid filter clause",
"innerError": {
"request-id": "9a4837b1-cbcf-4c0b-a54e-168959aeb4d8",
"date": "2019-08-12T07:47:12"
}
}
}
解决方案
但是在拨打这个电话时:
https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses/any(a: a/skuId eq 'c7df2760-2c81-4ef7-b578-5b5392b571df')
我得到[一个]异常。
试试这个电话:
https://graph.microsoft.com/v1.0/users?$top=999&$filter=assignedLicenses/any(x:x/skuId eq c7df2760-2c81-4ef7-b578-5b5392b571df)
推荐阅读
- javascript - 使用 JavaScript 在新选项卡中提交表单
- python - 是否可以创建 mediapipe 的身体姿势标志和连接的情节动画 3D 散点图?
- r - 从另一个数据框映射后获取笛卡尔积
- go - 有没有办法更新 go 包并忽略错误?
- jenkins - Jenkins Gitlab 多分支并发构建
- ios - 如何从 iTunes Connect 或 AppStore Connect 下载应用程序评论和评级
- java - Selenium Java 处理不同语言和位置以及设置动态架构的最佳实践?
- python - 如何使用熊猫有条件地格式化数据框并将其转换为图像?
- intellij-idea - 在 IntelliJ 中使用键盘快捷键在单独的窗格中打开文件
- c - 具有 C-Fortran 接口的全局缓冲区溢出