I'm trying to get all members of SharePoint 'Owners' and 'Members' groups across sites in my tenant. When I loop through the list of sites and use the following command for each site:
Get-SPOUser -Limit All
I get the groups and any users granted access to the site without being in a group but I don't get the members of the groups themselves.
I'm not able to pass the group name to the command below as the Members and Owners groups in my site aren't always called Owners or Members. The sites use different languages and the group names reflect this. So I'm not able to programmatically check the owners and members for each site.
Get-SPOUser -Group "RandomName" -Limit All
Is there a way to get owners and members of a site programmatically when you can't pass the group name to the
Get-SPOUser command. I couldn't find a property of the groups that would identify them as owners or members and use this property to pass the group to the
Note: Due to restrictions, I'm unable to use the PnP PowerShell module.