spo site list¶
Lists modern sites of the given type
m365 spo site list [options]
-t, --type [type]
- convenience option for type of sites to list. Allowed values are
- type of sites to list. To be used with values like
SITEPAGEPUBLISHING#0. Specify either
webTemplate, but not both.
-f, --filter [filter]
- filter to apply when retrieving sites
- use this switch to include OneDrive sites in the result when retrieving sites. Do not specify the
webTemplateoptions when using this.
- use this switch to only return deleted sites
-h, --help [help]
- Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
full. Default is
- JMESPath query string. See http://jmespath.org/ for more information and examples
-o, --output [output]
- Output type.
- Runs command with verbose logging
- Runs command with debug logging
To use this command you have to have permissions to access the tenant admin site.
-f, --filter option you can specify which sites you want to retrieve. For example, to get sites with project in their URL, use
Url -like 'project' as the filter.
When using the text output type, the command lists only the values of the
Url properties of the site. When setting the output type to JSON, all available properties are included in the command output.
List all sites in the currently connected tenant
m365 spo site list
List all group connected team sites in the currently connected tenant
m365 spo site list --type TeamSite
List all communication sites in the currently connected tenant
m365 spo site list --type CommunicationSite
List all group connected team sites that contain project in the URL
m365 spo site list --type TeamSite --filter "Url -like 'project'"
List all sites in the currently connected tenant including OneDrive sites
m365 spo site list --includeOneDriveSites
List all deleted sites in the tenant you're logged in to
m365 spo site list --deleted