title: Microsoft.Graph get all users of a group
body: <p>I'm using Microsoft.Graph and I want to return a list of all users in particular groups. I can not find any digestible information about this.</p>
  
  <p>I have tried using <code>.Request().Expand(x =&gt; x.Members)</code> but this only returns 20 users. And they are not paged (see <a href="https://msdn.microsoft.com/en-us/library/azure/ad/graph/howto/azure-ad-graph-api-supported-queries-filters-and-paging-options#expand" rel="nofollow noreferrer">here</a>).</p>
  
  <p>I can pull a list of groups fine, but how can I filter users based on what group they're in? This is what I've got so far...</p>
  
  <pre><code>public async Task Do()
  {
      var graphClient = new GraphServiceClient(_authProvider);
      var groups = await graphClient.Groups.Request().GetAsync();
  
      do
      {
          foreach (var group in groups)
          {
              Console.WriteLine($"{group.Id}, {group.DisplayName}");
              Console.WriteLine("------");
  
              var filter = $""; // What goes here?
              var users = await graphClient.Users.Request().Filter(filter).GetAsync();
  
              do
              {
                  foreach (var user in users)
                  {
                      Console.WriteLine($"{user.Id}, {user.GivenName} {user.Surname}, {user.MemberOf}");
                  }
              }
              while (users.NextPageRequest != null &amp;&amp; (users = await users.NextPageRequest.GetAsync()).Count &gt; 0);
  
              Console.WriteLine();
          }
      }
      while (groups.NextPageRequest != null &amp;&amp; (groups = await groups.NextPageRequest.GetAsync()).Count &gt; 0);
  }
  </code></pre>