Skip to main content

spo externaluser list

Lists external users in the tenant

Usage​

m365 spo externaluser list [options]

Options​

--filter [filter]

Limits the results to only those users whose first name, last name or email address begins with the text in the string, using a case-insensitive comparison.

-p, --pageSize [pageSize]

Specifies the maximum number of users to be returned in the collection. The value must be less than or equal to 50.

-i, --position [position]

Use to specify the zero-based index of the position in the sorted collection of the first result to be returned.

-s, --sortOrder [sortOrder]

Specifies the sort results in Ascending or Descending order on the SPOUser.Email property should occur. Allowed values asc|desc. Default asc.

-u, --siteUrl [siteUrl]

Specifies the site to retrieve external users for. If no site is specified, the external users for all sites are returned.

-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 is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks​

info

To use this command you must be either SharePoint Administrator or Global Administrator.

Examples​

List all external users from the current tenant. Show the first batch of 50 users.

m365 spo externaluser list --pageSize 50 --position 0

List all external users from the current tenant whose first name, last name or email address begins with Vesa. Show the first batch of 50 users.

m365 spo externaluser list --pageSize 50 --position 0 --filter Vesa

List all external users from the specified site. Show the first batch of 50 users.

m365 spo externaluser list --pageSize 50 --position 0 --siteUrl https://contoso.sharepoint.com

List all external users from the current tenant. Show the first batch of 50 users sorted descending by e-mail.

m365 spo externaluser list --pageSize 50 --position 0 --sortOrder desc

Response​

[
{
"Id": 14,
"IsHiddenInUI": false,
"LoginName": "i:0#.f|membership|user_domain.nl#ext#@tenant.onmicrosoft.com",
"Title": "Jon Doe",
"PrincipalType": 1,
"Email": "user@domain.nl",
"Expiration": "",
"IsEmailAuthenticationGuestUser": false,
"IsShareByEmailGuestUser": true,
"IsSiteAdmin": false,
"UserId": null,
"UserPrincipalName": "user_domain.nl#ext#@tenant.onmicrosoft.com"
}
]