Skip to main content

spo tenant site list

Lists modern sites of the given type

Usage

m365 spo tenant site list [options]

Alias

m365 spo site list

Options

-t, --type [type]

convenience option for type of sites to list. Allowed values are TeamSite,CommunicationSite.

--webTemplate [webTemplate]

type of sites to list. To be used with values like GROUP#0 and SITEPAGEPUBLISHING#0. Specify either type or webTemplate, but not both.

--filter [filter]

filter to apply when retrieving sites

--includeOneDriveSites

use this switch to include OneDrive sites in the result when retrieving sites. Do not specify the type or webTemplate options when using this.

-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 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

Using the --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 Title, and Url properties of the site. When setting the output type to JSON, all available properties are included in the command output.

If you wish to list deleted sites in your tenant, you should use the command spo tenant recyclebinitem list

info

To use this command you have to have permissions to access the tenant admin site.

Examples

List all sites in the currently connected tenant

m365 spo tenant site list

List all group connected team sites in the currently connected tenant

m365 spo tenant site list --type TeamSite

List all communication sites in the currently connected tenant

m365 spo tenant site list --type CommunicationSite

List all group connected team sites that contain project in the URL

m365 spo tenant site list --type TeamSite --filter "Url -like 'project'"

List all sites in the currently connected tenant including OneDrive sites

m365 spo tenant site list --includeOneDriveSites

Response

[
{
"_ObjectType_": "Microsoft.Online.SharePoint.TenantAdministration.SiteProperties",
"_ObjectIdentity_": "c904bfa0-90e8-6000-a541-33f81aef922d|908bed80-a04a-4433-b4a0-883d9847d110:1e852b49-bf4b-4ba5-bcd4-a8c4706c8ed4\\\nSiteProperties\\\nhttps%3a%2f%2fcontoso.sharepoint.com%2fteams%2fteam1",
"AllowDownloadingNonWebViewableFiles": false,
"AllowEditing": false,
"AllowSelfServiceUpgrade": true,
"AnonymousLinkExpirationInDays": 0,
"AuthContextStrength": null,
"AuthenticationContextLimitedAccess": false,
"AuthenticationContextName": null,
"AverageResourceUsage": 0,
"BlockDownloadLinksFileType": 0,
"BlockDownloadMicrosoft365GroupIds": null,
"BlockDownloadPolicy": false,
"BlockGuestsAsSiteAdmin": 0,
"ClearRestrictedAccessControl": false,
"CommentsOnSitePagesDisabled": false,
"CompatibilityLevel": 15,
"ConditionalAccessPolicy": 0,
"CurrentResourceUsage": 0,
"DefaultLinkPermission": 0,
"DefaultLinkToExistingAccess": false,
"DefaultLinkToExistingAccessReset": false,
"DefaultShareLinkRole": 0,
"DefaultShareLinkScope": 0,
"DefaultSharingLinkType": 0,
"DenyAddAndCustomizePages": 2,
"Description": null,
"DisableAppViews": 0,
"DisableCompanyWideSharingLinks": 0,
"DisableFlows": 0,
"ExcludeBlockDownloadPolicySiteOwners": false,
"ExcludeBlockDownloadSharePointGroups": null,
"ExcludedBlockDownloadGroupIds": [],
"ExternalUserExpirationInDays": 0,
"GroupId": "/Guid(00000000-0000-0000-0000-000000000000)/",
"GroupOwnerLoginName": null,
"HasHolds": false,
"HubSiteId": "/Guid(b3adc7fd-ac6b-4c0b-86a0-447f14fe4d17)/",
"IBMode": null,
"IBSegments": [],
"IBSegmentsToAdd": null,
"IBSegmentsToRemove": null,
"IsGroupOwnerSiteAdmin": false,
"IsHubSite": false,
"IsTeamsChannelConnected": true,
"IsTeamsConnected": false,
"LastContentModifiedDate": "/Date(2023,5,14,7,30,33,573)/",
"Lcid": 1033,
"LimitedAccessFileType": 0,
"ListsShowHeaderAndNavigation": false,
"LockIssue": null,
"LockState": "Unlock",
"LoopDefaultSharingLinkRole": 0,
"LoopDefaultSharingLinkScope": 0,
"LoopOverrideSharingCapability": false,
"LoopSharingCapability": 0,
"MediaTranscription": 0,
"OverrideBlockUserInfoVisibility": 0,
"OverrideSharingCapability": false,
"OverrideTenantAnonymousLinkExpirationPolicy": false,
"OverrideTenantExternalUserExpirationPolicy": false,
"Owner": "john@contoso.onmicrosoft.com",
"OwnerEmail": null,
"OwnerLoginName": null,
"OwnerName": null,
"PWAEnabled": 1,
"ReadOnlyAccessPolicy": false,
"ReadOnlyForBlockDownloadPolicy": false,
"ReadOnlyForUnmanagedDevices": false,
"RelatedGroupId": "/Guid(e5b29bb6-21ca-4d00-8d0a-abf3b6857c52)/",
"RequestFilesLinkEnabled": false,
"RequestFilesLinkExpirationInDays": 0,
"RestrictedAccessControl": false,
"RestrictedAccessControlGroups": null,
"RestrictedAccessControlGroupsToAdd": null,
"RestrictedAccessControlGroupsToRemove": null,
"RestrictedToRegion": 3,
"SandboxedCodeActivationCapability": 0,
"SensitivityLabel": "/Guid(00000000-0000-0000-0000-000000000000)/",
"SensitivityLabel2": null,
"SetOwnerWithoutUpdatingSecondaryAdmin": false,
"SharingAllowedDomainList": null,
"SharingBlockedDomainList": null,
"SharingCapability": 0,
"SharingDomainRestrictionMode": 0,
"SharingLockDownCanBeCleared": false,
"SharingLockDownEnabled": false,
"ShowPeoplePickerSuggestionsForGuestUsers": false,
"SiteDefinedSharingCapability": 1,
"SiteId": "/Guid(a7c46398-494d-4a8d-b0db-f6e58432eb67)/",
"SocialBarOnSitePagesDisabled": false,
"Status": "Active",
"StorageMaximumLevel": 1048576,
"StorageQuotaType": null,
"StorageUsage": 0,
"StorageWarningLevel": 1022361,
"TeamsChannelType": 1,
"Template": "TEAMCHANNEL#1",
"TimeZoneId": 13,
"Title": "Benelux Demo 031622 - demo",
"TitleTranslations": null,
"Url": "https://contoso.sharepoint.com/teams/team1",
"UserCodeMaximumLevel": 300,
"UserCodeWarningLevel": 200,
"WebsCount": 0
}
]
CTRL + M