New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New command: m365 spo site membership get
#5980
Comments
m365 spo site membership get
Hi @mkm17 thank you for creating this issue. If it lists memberships of default groups, I think that's already possible using |
Hi, @milanholemans To be honest, it will retrieve the same data as in the provided examples by you. The only difference is that to execute The use case can be when there's a need to generate a report on the membership of multiple webs without direct access for current user. To address this scenario,
The similar case is mentioned here #5882 (comment) If adding a new command is not the best solution, maybe we can extend Then the command execution should cover only default groups and the execution would be like |
Hi @mkm17 thanks for clarifying. Does this endpoint only return the SharePoint groups? Could you give an example of a possible output? This would make it a bit clearer I guess. |
Hi @milanholemans, returns [
{
"userGroup": [
{
"email": "login@tenant.onmicrosoft.com",
"loginName": "i:0#.f|membership|login@tenant.onmicrosoft.com",
"name": "<Display Name>",
"userPrincipalName": "login@tenant.onmicrosoft.com"
}
]
},
{
"userGroup": []
},
{
"userGroup": []
}
] The first user group corresponds to Owners, the next one to Members, and the last one to visitors. As I mentioned before, the real case scenario could be generating a membership report while the user is only a SharePoint admin without access to the Site as a Site collection admin. |
Usage
m365 spo site membership get
Description
Retrieve information about default site groups' membership.
Options
-u, --siteUrl <siteUrl>
-r, --role [role]
Examples
Retrieves information about default site groups' owners, members, and visitors of the site.
Retrieves information about site owners.
Default properties
Additional Info
This command could be helpful for SharePoint administrators, It would allow getting information about membership of a site using the
_api/SPO.Tenant/sites/GetSiteUserGroups
endpoint, like in the SP admin page.The benefit here is that administrators can access this information with SharePoint admin permission only, without needing site collection admin permission.
The text was updated successfully, but these errors were encountered: