spo site admin list
Lists all administrators of a specific SharePoint site
Usage
m365 spo site admin list [options]
Options
-u, --siteUrl <siteUrl>
The URL of the SharePoint site
--asAdmin
List admins as admin for sites you don't have permission to
-h, --help [help]
Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options
,examples
,remarks
,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
.--verbose
Runs command with verbose logging.
--debug
Runs command with debug logging.
Remarks
To use this command with the --asAdmin
mode, you must be at least SharePoint administrator.
Without this parameter, you must have site collection admin permissions for the requested site.
Examples
Lists all admins of a SharePoint site
m365 spo site admin list --siteUrl https://contoso.sharepoint.com
Lists all admins of a SharePoint site as admin
m365 spo site admin list --siteUrl https://contoso.sharepoint.com --asAdmin
Response
Standard response
- JSON
- Text
- CSV
- Markdown
[
{
"Id": 6,
"LoginName": "i:0#.f|membership|[email protected]",
"Title": "User Example",
"PrincipalType": 1,
"PrincipalTypeString": "User",
"Email": "[email protected]",
"IsPrimaryAdmin": true
}
]
Id LoginName Title PrincipalTypeString
-- --------------------------------------------------------------------------- ------- -------------------
15 c:0o.c|federateddirectoryclaimprovider|d8430798-5a00-00ba-83b0-dd7a032d549a Members SecurityGroup
Id,LoginName,Title,PrincipalType,PrincipalTypeString,Email,IsPrimaryAdmin
6,i:0#.f|membership|[email protected],User Example,1,User,[email protected],1
# spo site admin list --siteUrl "https://contoso.sharepoint.com/sites/Test"
Date: 20/03/2024
## User Example
Property | Value
---------|-------
Id | 6
LoginName | i:0#.f\|membership\|[email protected]
Title | User Example
PrincipalType | 1
PrincipalTypeString | User
Email | [email protected]
IsPrimaryAdmin | true
asAdmin
response
When we make use of the option asAdmin
the response will differ.
- JSON
- Text
- CSV
- Markdown
[
{
"Email": "[email protected]",
"LoginName": "i:0#.f|membership|[email protected]",
"Title": "User Example",
"IsPrimaryAdmin": true
}
]
LoginName Title
--------------------------------------------------------------------------- ---------------
c:0o.c|federateddirectoryclaimprovider|d8430798-5a00-00ba-83b0-dd7a032d549a Members
Email,LoginName,Title,IsPrimaryAdmin
[email protected],i:0#.f|membership|[email protected],User Example,1
# spo site admin list --siteUrl "https://contoso.sharepoint.com/sites/Test" --asAdmin
Date: 20/03/2024
## User Example
Property | Value
---------|-------
Email | [email protected]
LoginName | i:0#.f\|membership\|[email protected]
Title | User Example
IsPrimaryAdmin | true