Hi @Kevin Thankachan ,
Use expand() like this:
graph.groups.getById(groupId).expand("members")()
Here is the full code snippet, please refere:
private GetGroupMembers()
{
graph.groups.top(999).select('mailNickname,id').get().then(groups=>{
console.log(groups);
groups.forEach( group=>{
if(group['mailNickname']== "NewProvision")
{
let groupId = group['id'];
const groupMembers = graph.groups.getById(groupId).expand("members")().then(group=>{
console.log(group.members);
});
}
})
}).catch((err) => {
console.log("Error fetching Group ID "+err)});
}
Here is a similiar question here for your reference:
PnPJS Graph : how to list all members of a Group
Thanks
Best Regards
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.