spo site classic list¶
Lists classic sites of the given type
spo site classic list [options]
||output usage information|
||type of classic sites to list.|
||filter to apply when retrieving sites|
||option to include OneDrive sites or not.|
||Runs command with verbose logging|
||Runs command with debug logging|
Before using this command, log in to a SharePoint Online tenant admin site, using the spo login command.
To list classic sites, you have to first log in to a tenant admin site using the spo login command, eg.
spo login https://contoso-admin.sharepoint.com. If you are logged in to a different site and will try to list the available sites, you will get an error.
-t, --webTemplate option you can specify which sites you want to retrieve. For example, to get sites with the
STS#0 as their web template, use
--webTemplate STS#0 as the option.
-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.
--includeOneDriveSitesoption you can specify whether you want to retrieve OneDrive sites or not. For example, to retrieve OneDrive sites, use
--includeOneDriveSites as the option.
List all classic sites in the currently connected tenant
spo site classic list
List all classic team sites in the currently connected tenant including OneDrive sites
spo site classic list --includeOneDriveSites
List all classic team sites in the currently connected tenant
spo site classic list --webTemplate STS#0
List all classic project sites that contain project in the URL
spo site classic list --webTemplate PROJECTSITE#0 --filter "Url -like 'project'"