import Global from '../../_global.mdx'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
Lists hub sites in the current tenant
m365 spo hubsite list [options]`--withAssociatedSites`
: Include the associated sites in the result (only in JSON output).When using the text or csv output type, the command lists only the values of the ID, SiteUrl and Title properties of the hub site. With the output type as JSON, all available properties are included in the command output.
List hub sites in the current tenant
m365 spo hubsite listList hub sites, including their associated sites, in the current tenant. Associated site info is only shown in JSON output.
m365 spo hubsite list --withAssociatedSites --output json[
{
"Description": "Intranet Hub Site",
"EnablePermissionsSync": false,
"EnforcedECTs": null,
"EnforcedECTsVersion": 0,
"HideNameInNavigation": false,
"ID": "af80c11f-0138-4d72-bb37-514542c3aabb",
"LogoUrl": "https://contoso.sharepoint.com/sites/intra/SiteAssets/work.png",
"ParentHubSiteId": "ec78f3aa-5a74-4f16-be49-3396df045f34",
"PermissionsSyncTag": 0,
"RequiresJoinApproval": false,
"SiteDesignId": "184644fb-90ed-4841-a7ad-6930cf819060",
"SiteId": "af80c11f-0138-4d72-bb37-514542c3aabb",
"SiteUrl": "https://contoso.sharepoint.com/sites/intra",
"Targets": null,
"TenantInstanceId": "5d128b52-7228-46b5-8765-5b338476054d",
"Title": "Intranet"
}
]ID SiteUrl Title
------------------------------------ ------------------------------------------ --------
af80c11f-0138-4d72-bb37-514542c3aabb https://contoso.sharepoint.com/sites/intra Intranet
ID,SiteUrl,Title
af80c11f-0138-4d72-bb37-514542c3aabb,https://contoso.sharepoint.com/sites/intra,Intranet# spo hubsite list
Date: 2/20/2023
## Intranet (af80c11f-0138-4d72-bb37-514542c3aabb)
Property | Value
---------|-------
Description | Intranet Hub Site
EnablePermissionsSync | false
EnforcedECTs | null
EnforcedECTsVersion | 0
HideNameInNavigation | false
ID | af80c11f-0138-4d72-bb37-514542c3aabb
LogoUrl | https://contoso.sharepoint.com/sites/intra/SiteAssets/work.png
ParentHubSiteId | ec78f3aa-5a74-4f16-be49-3396df045f34
PermissionsSyncTag | 0
RequiresJoinApproval | false
SiteDesignId | 184644fb-90ed-4841-a7ad-6930cf819060
SiteId | af80c11f-0138-4d72-bb37-514542c3aabb
SiteUrl | https://contoso.sharepoint.com/sites/intra
Targets | null
TenantInstanceId | 5d128b52-7228-46b5-8765-5b338476054d
Title | IntranetWhen we make use of the option withAssociatedSites the response will differ.
[
{
"Description": "Intranet Hub Site",
"EnablePermissionsSync": false,
"EnforcedECTs": null,
"EnforcedECTsVersion": 0,
"HideNameInNavigation": false,
"ID": "af80c11f-0138-4d72-bb37-514542c3aabb",
"LogoUrl": "https://contoso.sharepoint.com/sites/intra/SiteAssets/work.png",
"ParentHubSiteId": "ec78f3aa-5a74-4f16-be49-3396df045f34",
"PermissionsSyncTag": 0,
"RequiresJoinApproval": false,
"SiteDesignId": "184644fb-90ed-4841-a7ad-6930cf819060",
"SiteId": "af80c11f-0138-4d72-bb37-514542c3aabb",
"SiteUrl": "https://contoso.sharepoint.com/sites/intra",
"Targets": null,
"TenantInstanceId": "5d128b52-7228-46b5-8765-5b338476054d",
"Title": "Intranet",
"AssociatedSites": [
{
"Title": "About Us",
"SiteUrl": "https://contoso.sharepoint.com/sites/about-us"
}
]
}
]ID SiteUrl Title
------------------------------------ ------------------------------------------ --------
af80c11f-0138-4d72-bb37-514542c3aabb https://contoso.sharepoint.com/sites/intra Intranet
ID,SiteUrl,Title
af80c11f-0138-4d72-bb37-514542c3aabb,https://contoso.sharepoint.com/sites/intra,Intranet# spo hubsite list --withAssociatedSites "true"
Date: 2/20/2023
## Intranet (af80c11f-0138-4d72-bb37-514542c3aabb)
Property | Value
---------|-------
Description | Intranet Hub Site
EnablePermissionsSync | false
EnforcedECTs | null
EnforcedECTsVersion | 0
HideNameInNavigation | false
ID | af80c11f-0138-4d72-bb37-514542c3aabb
LogoUrl | https://contoso.sharepoint.com/sites/intra/SiteAssets/work.png
ParentHubSiteId | ec78f3aa-5a74-4f16-be49-3396df045f34
PermissionsSyncTag | 0
RequiresJoinApproval | false
SiteDesignId | 184644fb-90ed-4841-a7ad-6930cf819060
SiteId | af80c11f-0138-4d72-bb37-514542c3aabb
SiteUrl | https://contoso.sharepoint.com/sites/intra
Targets | null
TenantInstanceId | 5d128b52-7228-46b5-8765-5b338476054d
Title | Intranet- SharePoint hub sites new in Microsoft 365: https://techcommunity.microsoft.com/t5/SharePoint-Blog/SharePoint-hub-sites-new-in-Office-365/ba-p/109547