我正在尝试使用Graph API获取所有用户Outlook组名称。但是我得到了所有的O365用户组,但是我只想要用户Outlook组。
由于没有得到更多信息,为了区分“用户Outlook组”和“ O365用户组”,我想您提到的“用户Outlook组”是Outlook中的分发列表。
首先,请参阅O365组的以下3个重要属性:Working with groups in Microsoft Graph。
因此,我们需要通过过滤3个属性来查询通讯组列表:groupTypes,mailEnabled,securityEnabled。
由于Azure AD资源不支持not equals (ne)
,因此我们无法直接使用ne
列出通讯组列表。
所以我们需要这样做:
GET
https://graph.microsoft.com/v1.0/groups?$filter=mailEnabled eq true
and securityEnabled eq false
。