4

According to the on-line docs at https://learn.microsoft.com/en-us/graph/api/resources/groups-overview?view=graph-rest-1.0 there are four AAD groups: Office365, security, email-enabled security, and distribution.

I'm using the following to list groups:

        graphGroupsPages = await graphServiceClient.Groups
            .Request()
            //.Filter(????) <= if yes, what should it be?
            .GetAsync();

I've seen an example of how to list Office365 (Unified) groups.

How do I list security groups only?

gordieb
  • 223
  • 2
  • 14
  • If my answer is helpful for you, you can accept it as answer( click on the check mark beside the answer to toggle it from greyed out to filled in.). See https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work. This can be beneficial to other community members. Thank you. – Allen Wu Apr 23 '20 at 09:40

1 Answers1

7

Based on the document, you should list the groups whose mailEnabled is false and securityEnabled is true.

var graphGroupsPages = await graphServiceClient.Groups.Request().Filter("mailEnabled eq false and securityEnabled eq true").GetAsync();
Allen Wu
  • 15,529
  • 1
  • 9
  • 20