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 have permission to access the tenant admin site.
Without this parameter, you must have site collection admin permissions for the requested site.
In --asAdmin
mode, the Id, PrincipalType, and PrincipalTypeString properties are not exported.
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
- JSON
- Text
- CSV
- Markdown
[
{
"Id": 6,
"LoginName": "i:0#.f|membership|user@contoso.com",
"Title": "User Example",
"PrincipalType": 1,
"PrincipalTypeString": "User",
"Email": "user@contoso.com",
"IsPrimaryAdmin": true
}
]
Email : user@contoso.com
Id : 6
LoginName : i:0#.f|membership|user@contoso.com
PrincipalType : 1
PrincipalTypeString : User
Title : User Example
IsPrimaryAdmin : true
Id,LoginName,Title,PrincipalType,PrincipalTypeString,Email,IsPrimaryAdmin
6,i:0#.f|membership|user@contoso.com,User Example,1,User,user@contoso.com,1
# spo site admin list --siteUrl "https://contoso.sharepoint.com/sites/Test"
Date: 20/03/2024
## User
Property | Value
---------|-------
Id | 6
LoginName | i:0#.f\|membership\|user@contoso.com
Title | User Example
PrincipalType | 1
PrincipalTypeString | User
Email | user@contoso.com
IsPrimaryAdmin | true