Azure GraphClient Get Users By Group Names
<p>I'm trying to retrieve user list from AAD by a list of group names.</p>

<p>This code:</p>

<pre><code>var roleGroups = new string[] { "Group Name 1", "Group Name 2" };

ActiveDirectoryClient client = AuthenticationHelper.GetActiveDirectoryClient();

var users = client.Users.Where(u =&gt; u.CheckMemberGroupsAsync(roleGroups).Result.Any());
</code></pre>

<p>throws:</p>

<blockquote>
  <p>CheckMemberGroupsAsync declared on type
  'Microsoft.Azure.ActiveDirectory.GraphClient.IDirectoryObject' cannot
  be called with instance of type
  'Microsoft.Azure.ActiveDirectory.GraphClient.Internal.User'</p>
</blockquote>

<p>I've also tried:  </p>

<pre><code>  client.Users.Where(u =&gt;((User)u).MemberOf.OfType&lt;Group&gt;()             
   .Any(g =&gt; roleGroups.Contains(g.DisplayName))).ExecuteAsync()         
    .Result.CurrentPage.Select(u =&gt; (User)u).ToList();
</code></pre>

<p>And</p>

<pre><code>client.Users.Where(u =&gt; u.GetMemberGroupsAsync(null).Result.Any(g =&gt; roleGroups.Contains(g)));
</code></pre>

<p>which throws:</p>

<blockquote>
  <p>GetMemberGroupsAsync declared on type
  'Microsoft.Azure.ActiveDirectory.GraphClient.IDirectoryObject' cannot
  be called with instance of type
  'Microsoft.Azure.ActiveDirectory.GraphClient.Internal.User'</p>
</blockquote>

<p>How can I get a list of users (<code>Microsoft.Azure.ActiveDirectory.GraphClient.User</code>) by a list of group names?</p>