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, connect to a SharePoint Online tenant admin site, using the spo connect command.
To list classic sites, you have to first connect to a tenant admin site using the spo connect command, eg.
spo connect https://contoso-admin.sharepoint.com. If you are connected 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'"