我计划利用List Groups Ms graph API来列出我组织中的 O365 组,然后为 Yammer 组过滤它们。
当我在图形资源管理器中使用此 API 时,它会返回以下响应对象。
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"@odata.nextLink": "https://graph.microsoft.com/v1.0/groups?,
"value": [
{
"id": "",
"description": "",
"displayName": "",
"groupTypes": [
"Unified"
],
"isAssignableToRole": null,
"mail": "",
"mailEnabled": true,
"mailNickname": "",
"onPremisesDomainName": null,
"onPremisesLastSyncDateTime": null,
"onPremisesNetBiosName": null,
"onPremisesSamAccountName": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"preferredDataLocation": null,
"proxyAddresses": [
"",
"SMTP:",
"smtp:"
],
"renewedDateTime": "2018-09-07T16:23:37Z",
"onPremisesProvisioningErrors": []
},
{
"id": "",
"deletedDateTime": null,
"classification": null,
"createdDateTime": "2019-01-11T17:34:30Z",
"**creationOptions**": [
"Team",
"ExchangeProvisioningFlags"
],
"description": "Discuss",
"displayName": "I&O",
"groupTypes": [
"Unified"
],
"isAssignableToRole": null,
"mail": "",
"preferredDataLocation": null,
"proxyAddresses": [
"SPO",
"SMTP:",
"smtp:"
],
"renewedDateTime": "2019-01-11T17:34:30Z",
"resourceBehaviorOptions": [],
"resourceProvisioningOptions": [
"Team"
],
"onPremisesProvisioningErrors": []
},
{
"id": "",
"deletedDateTime": null,
"classification": null,
"createdDateTime": "2018-12-10T21:14:47Z",
"**creationOptions**": [
"YammerProvisioning"
],
"description": "",
"displayName": "",
"groupTypes": [
"Unified"
],
"isAssignableToRole": null,
"mailEnabled": true,
"onPremisesDomainName": null,
"onPremisesLastSyncDateTime": null,
"onPremisesNetBiosName": null,
"onPremisesSamAccountName": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"preferredDataLocation": null,
"proxyAddresses": [],
"renewedDateTime": "2018-12-10T21:14:47Z",
"resourceBehaviorOptions": [
"CalendarMemberReadOnly"
],
"resourceProvisioningOptions": [],
"onPremisesProvisioningErrors": []
}
]
}
如您所见,json 中的每个对象都有“creationOptions”,这意味着一个组可能会在该字段中填充一些值。我有兴趣只返回那些creationOptions = YammerProvisioning 的组。
但是 $filter 只能应用于字符串而不是数组,所以我不确定如何正确地查询。我尝试关注但是,它的过滤器子句无效。
https://graph.microsoft.com/v1.0/groups?$filter=equals(creationOptions,'YammerProvisioning')
我尝试的另一种方法如下,它给出了相同的数组。
https://graph.microsoft.com/v1.0/groups?$filter=startswith(creationOptions,['YammerProvisioning'])
我的目标是简单地获取所有具有 creationOptions 为“YammerProvisioning”的组
帮助或示例表示赞赏:) 谢谢