spo site membership list
Retrieves information about default site groups' membership
Usage
m365 spo site membership list [options]
Options
-u, --siteUrl <siteUrl>The URL of the site.
-r, --role [role]Filter the results to include only users with the specified roles:
Owner,Member, orVisitor.
-h, --help [help]Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options,examples,remarks,permissions,response,full. Default isoptions.--query [query]JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]Output type.
json,text,csv,md,none. Defaultjson.--verboseRuns command with verbose logging.
--debugRuns command with debug logging.
Remarks
To use this command, you must be a Global or SharePoint administrator.
For other scenarios, refer to the spo web get --withGroups and spo group member list commands.
Examples
Retrieve information about default site groups' owners, members, and visitors of the site.
m365 spo site membership list --siteUrl https://contoso.sharepoint.com
Retrieve information about site owners.
m365 spo site membership list --siteUrl https://contoso.sharepoint.com --role Owner
Response
- JSON
- Text
- CSV
- Markdown
{
"AssociatedOwnerGroup": [
{
"email": "jdoe@contoso.onmicrosoft.com",
"loginName": "i:0#.f|membership|jdoe@contoso.onmicrosoft.com",
"name": "John Doe",
"userPrincipalName": "jdoe@contoso.onmicrosoft.com"
}
],
"AssociatedMemberGroup": [
{
"email": "avance@contoso.onmicrosoft.com",
"loginName": "i:0#.f|membership|avance@contoso.onmicrosoft.com",
"name": "Adele Vance",
"userPrincipalName": "avance@contoso.onmicrosoft.com"
}
],
"AssociatedVisitorGroup": [
{
"email": "",
"loginName": "c:0-.f|rolemanager|spo-grid-all-users/dc109ffd-4298-487e-9cbc-6b9b1a2cd3e2",
"name": "Everyone except external users",
"userPrincipalName": null
}
]
}
email name userPrincipalName associatedGroupType
-------------------------------- ------------------------------ -------------------------------- -------------------
jdoe@contoso.onmicrosoft.com John Doe jdoe@contoso.onmicrosoft.com Owner
email,loginName,name,userPrincipalName,associatedGroupType
jdoe@contoso.onmicrosoft.com,i:0#.f|membership|jdoe@contoso.onmicrosoft.com,John Doe,jdoe@contoso.onmicrosoft.com,Owner
# spo site membership list --siteUrl "https://contoso.sharepoint.com/sites/AudienceTest"
Date: 11/08/2024
## John Doe
Property | Value
---------|-------
email | jdoe@contoso.onmicrosoft.com
loginName | i:0#.f\|membership\|jdoe@contoso.onmicrosoft.com
name | John Doe
userPrincipalName | jdoe@contoso.onmicrosoft.com
associatedGroupType | Owner