I'm trying to find the owners and members for a given site. Once we have the site we get the given groups for each of the following:
- associatedMemberGroup
- associatedOwnerGroup
The code we use is below:
const memberGroup = await context.associatedMemberGroup();
const memberOwnerDetails = await context.siteGroups
.getByName(memberGroup.LoginName)
.expand('Users')();
The result brings back a member but the type is SecurityGroup (type 4) and not type user (type 2). We are expecting three members to be returned but instead we get the one member of type SecurityGroup and as such not getting the list of members we are expecting.
I've found the called made by SharePoint which is as follows but can't find the equivalent with pnp js.
Any suggestions on how/why it works this way and the calls that we should be using to get the correct information would be much appreciated.