我试图使用Microsoft Graph API获取具有特定许可证的用户列表。这可以使用Graph Explorer进行测试。使用OData在guid上过滤(Microsoft Graph)
这是什么返回一个用户裁剪例如:
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#users/$entity",
"id": "69615b5e-8b26-430c-ae89-4e626f5ba240",
"accountEnabled": true,
"assignedLicenses": [
{
"disabledPlans": [],
"skuId": "f8a1db68-be16-40ed-86d5-cb42ce701560"
},
{
"disabledPlans": [],
"skuId": "6fd2c87f-b296-42f0-b197-1e91e994b900"
}
]
}
我想有一个分配的许可证以“f8a1db68-be16-40ed-86d5- skuId
所有用户的列表cb42ce701560"
这是我到目前为止已经试过:
https://graph.microsoft.com/beta/users?$filter=AssignedLicenses/any(a:a/SkuId eq 'f8a1db68-be16-40ed-86d5-cb42ce701560')
给我的错误:
A binary operator with incompatible types was detected. Found operand types 'Edm.Guid' and 'Edm.String' for operator kind 'Equal'.
https://graph.microsoft.com/beta/users?$filter=AssignedLicenses/any(a:a/SkuId eq f8a1db68-be16-40ed-86d5-cb42ce701560)
给我的错误:
')' or ',' expected at position 42 in 'assignedLicenses/any(a:a/skuId eq f8a1db68-be16-40ed-86d5-cb42ce701560)'.
https://graph.microsoft.com/beta/users?$filter=AssignedLicenses/any(a:a/SkuId eq cast('f8a1db68-be16-40ed-86d5-cb42ce701560',Edm.Guid))
给我的错误:
The child type 'Edm.Guid' in a cast was not an entity type. Casts can only be performed on entity types.
这SO post表明,我第一次尝试的工作,但事实并非如此。我做错了什么,或者只是无法通过许可分配进行过滤?