2

我计划利用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”的组

帮助或示例表示赞赏:) 谢谢

4

1 回答 1

3

这种语法应该可以工作,但它可能在 v1.0 中不受支持。?$filter=creationOptions/any(r:r+eq+'YammerProvisioning')

Beta 端点似乎没有creationOptions,但您可以尝试反对resourceBehaviorOptions。

https://www.techmikael.com/2017/11/how-to-list-all-office-365-groups-which.html?m=1

尽管它在所有租户中都不可靠(“但是,并非所有启用 Yammer 的组都通过查看 ResourceBehaviorOptions 来报告。似乎在迁移之前已经使用 Office 365 组的 Yammer 社区配置了属性,而社区转换为 Office 365 组在迁移期间没有。也许一些后台进程会随着时间的推移更新其他组的属性。") https://office365itpros.com/2020/04/13/moving-yammer-networks-native-mode-microsoft-365 /

于 2020-05-25T17:27:14.660 回答