Hi dear @Ahsan Habib I tested your code and it seems to be no problem, I can return all the results. Below is my complete code, you can have a try.
using System;
using Microsoft.Identity.Client;
using Microsoft.Graph.Auth;
using Microsoft.Graph;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace test
{
class Program
{
static async System.Threading.Tasks.Task Main(string[] args)
{
IConfidentialClientApplication app;
app = ConfidentialClientApplicationBuilder.Create("{client id}")
.WithClientSecret("{Client Secret}")
.WithAuthority(new Uri("https://login.microsoftonline.com/{tenant id}"))
.Build();
AuthenticationResult result = null;
string[] scopes = new string[] { "https://graph.microsoft.com/.default" };
result = await app.AcquireTokenForClient(scopes).ExecuteAsync();
string accesstoken = result.AccessToken;
//Console.WriteLine(accesstoken);
ClientCredentialProvider authProvider = new ClientCredentialProvider(app);
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
var membersRequestUrl = graphClient.Groups["{group id}"]
.Members
.AppendSegmentToRequestUrl("microsoft.graph.user?$count=true");
var requestBuilder = new GroupMembersCollectionWithReferencesRequestBuilder(membersRequestUrl, graphClient);
var memberRequest = requestBuilder
.Request()
.Header("ConsistencyLevel", "eventual")
.Select("displayName,id,mail")
.Expand("memberOf($select=id,displayName)");
Console.WriteLine(memberRequest.GetHttpRequestMessage().RequestUri);
var members = await memberRequest.GetAsync();
Console.WriteLine(JsonConvert.SerializeObject(members));
}
}
}