30,269 total views, 11 views today
In this article, we’ll discuss and learn about Hub Sites in SharePoint online modern site like what is a hub site in SharePoint online, why hub Site in SharePoint online, how to create a Hub site in SharePoint online, how to add a Team site or communication site in Hub Site and few tips to create hub site in SharePoint online – office 365 and also we will see that how to create a hub site using PnP PowerShell, finally at end of this article, we will understand “Why should we create a hub site in SharePoint Online (benefits of SharePoint hub site)?”
Table of Contents
- Introduction
- What is the Hub site in SharePoint online?
- Why Hub Site in SharePoint online?
- How to create a Hub site in SharePoint online?
- How to add a Team site or communication site in Hub Site?
- Some key features or use cases of Hub sites in SharePoint Online.
- How to create a new hub site using PowerShell?
- Register a site as a hub site by using the Register-SPOHubSite cmdlet
- Set permissions for specific users: SPOHubSiteRights
- Set permissions for specific users: Grant-PnPHubSiteRights
- Add-PnPHubSiteAssociation: PnP Hub site
- Associate multiple sites to a hub site: Import-Csv to Add-PnPHubSiteAssociation
- Summarize – what we had here?
- Latest update on Hub Site from Microsoft.
- References
Introduction
These days hub sites, modern sites, megamenu are buzz-words in the modern SharePoint world and hub sites are the heart of all these – rather I would say hub site is a subset of SharePoint site administration or mini modern admin center with respect to site administration. So in this article, I’ll focus on what is a hub site, use cases of hub sites, and how this can be configured, etc.
What is a Hub Site in SharePoint online?
In simple words, we can say that the Hub Site is a collection of sites connected to a master site from where all connected sites can be navigated and managed. It has the following key attributes.
- Discover related content such as news and other site activities,
- Apply common navigation, branding and site structure across associated sites
- Search across all associated sites.
Example – let’s say you are a project manager and managing multiple projects in SharePoint, .NET, and Java, etc. And for these different types of projects, you have different site collections. Now, we want to maintain the same look and feel for all the project sites and want to navigate through from one project site to another project site seamlessly and want to share the common news across all departments/project sites. Here, Hub Site is a way to go. We need to connect these site collections to a Hub site. In the coming section, we’ll see how a site can be connected to a Hub Site.
Hub Site architecture in SharePoint online

Image Source: https://docs.microsoft.com/en-us/sharepoint/planning-hub-sites
Why Hub Site in SharePoint online?
For our above project sites scenario – if we want to achieve the same, we need to have a root site called Projects and under this, various subsites (SharePoint, .NET, Java, etc.) which will form the nested architecture and this will lead to a bad user adoption experience when it comes to navigation. One other really big challenge – let’s say we have 10 subsites and out of 10, in one subsite, we need to activate a feature (let’s consider publishing feature) which has a dependency with site collection level feature, so first, we need to activate in site collection level even though it is irrelevant for other 9 subsites. As a result, for a site administrator, it is very difficult to manage. So, Microsoft has recommended using flat architecture, i.e., no subsites. We should adapt to create a new site collection for each requirement. Whether we like or not, we are bound to adopt this fashion – let’s say we have created an Office 365 group and immediately if we come to active sites pages in the modern admin center, we can see one modern new site has been created automatically with the Office 365 group name.
Note:
- Having said this, it does not mean that we cannot create a subsite – still, we can, but Microsoft does not recommend it.
How to create a Hub Site in SharePoint online?
Any active site can be designated as a Hub Site through the modern SharePoint Office 365 admin center or PnP command. Go to the modern SharePoint admin page and under the site, click on Active Sites.

Now, we can see all available active sites out here – now planning to make “TestSite001” as Hub Site. To do this, let’s follow the below steps.
- Select the “TestSite001” radio button
- Click on “Hub” drop-down list
- Click on “Register as hub site”
- Give the display name of the hub site and owner
- Then, click the Save button
This will take some time to complete all the required settings.

SharePoint online configures hub site:

Now, a site has been configured as a “Hub Site”. Note
In a tenant, we can have multiple Hub Sites (maximum 100 sites)
How to add a Team site or communication site to the Hub Site?
Adding a site to a Hub Site is like adding a brother and sister to an elder brother (i.e. Hub Site). Now, we’ll see how a new and existing site can be connected to a Hub Site. This is the homepage of the newly created Hub Site.

Click on the +Create site button, then give the site name; For example, “TestTeamSite_Brother” (we can give any name). Then, click the “Save” button.

Now, we can see the wonder – come to the SharePoint modern admin homepage and go to Active Sites screen. We can see the newly created Team site listed out here which is connected to the Hub – Project “Hub Site”.

Another way is, we can connect any existing site to a hub site. Let’s do that – select the particular existing site radio button and from the Hub menu, click on “Associate with a Hub” link.

Select the Hub Site from the dropdown list and click on the Save button. This will take some time to do the all required configuration.

Some key features or use cases of Hub Sites.
- Shared navigation
- Search across the hub
- News roll-up
- Associated sites
- Highlighted content
- Events
How to create hub-site in SharePoint online – using PowerShell?
Connect-PnPOnline -SPOManagementShell New-PnPSite -Type TeamSite -title "Contoso marketing division" -alias "marketing" -Description "Main site for collaboration for marketing teams at Contoso"
Register a site as a hub site by using the Register-SPOHubSite cmdlet:
Register-SPOHubSite -Site https://contoso.sharepoint.com/sites/marketing
Set permissions for specific users: SPOHubSiteRights
Grant-SPOHubSiteRights -Identity https://contoso.sharepoint.com/sites/marketing -Principals "nestorw@contoso" -Rights Join
Set permissions for specific users: Grant-PnPHubSiteRights
Grant-PnPHubSiteRights -Identity https://contoso.sharepoint.com/sites/hubsite -Principals "myuser@mydomain.com","myotheruser@mydomain.com" -Rights Join
Add-PnPHubSiteAssociation: PnP Hub site
$myHubsite = "https://globalsharepoint2019.sharepoint.com/sites/TestHubSite" $siteUrl = "https://globalsharepoint2019.sharepoint.com/sites/TestTeamSite" Add-PnPHubSiteAssociation -Site $SiteUrl -HubSite $myHubsite
Associate multiple sites to a hub site: Import-Csv to Add-PnPHubSiteAssociation
Using the below PnP PowerShell we can add or register multiple sites to a hub site by importing the sites CSV file.
$mySitesCSV = Import-Csv -Path "C:\temp\MySitesToAssociate.csv" $myHubsite = "https://"<tenantname>".sharepoint.com/sites/TestHubSite" foreach ($oneSite in $mySitesCSV) { Add-PnPHubSiteAssociation -Site $oneSite.SiteUrl -HubSite $myHubsite }
Reference: https://docs.microsoft.com/en-us/sharepoint/dev/features/hub-site/create-hub-site-with-powershell
Summarize – what we had here?
Thus, we have learned – what is hub site, how to configure/create hub sites, use cases of hub sites, summarized as below:
Understanding the hub sites in SharePoint online
SharePoint hub site examples
SharePoint hub sites limitations
SharePoint hub site navigation
SharePoint hub sites vs subsites
How to create a hub site
create a hub site in SharePoint online
create SharePoint hub site
what is a SharePoint hub site
SharePoint hub sites new in Office 365
How to Create Hub Sites in SharePoint Online – SharePoint Online
Overview Of Hub Sites In SharePoint Online
- How to create a new hub site using PowerShell?
- Register a site as a hub site by using the Register-SPOHubSite cmdlet
- Set permissions for specific users: SPOHubSiteRights
- Set permissions for specific users: Grant-PnPHubSiteRights
- Add-PnPHubSiteAssociation: PnP Hub site
- Associate multiple sites to a hub site: Import-Csv to Add-PnPHubSiteAssociation
Latest update on Hub Site from Microsoft
I’ll keep it updated in this section – if any changes come from Microsoft on Hub Site.
As per SharePoint Roadmap Pitstop June 2019, the SharePoint hub site limit will go up from 100 to 2000. Please click here for more details.
References
- Please click here to know more about the features and use cases.
- Create SharePoint hub sites by using PowerShell
See Also
- Office 365: Getting started with SharePoint PnP PowerShell – installation
- In 2 steps convert a classic SharePoint page to modern using PnP
- Office 365: Retrieve hub sites and associated sites using PnP Powershell
- Create modern team site using PnP PowerShell – SharePoint
- In 4 steps access SharePoint online data using postman tool
- SharePoint admin center: Learn SharePoint online administration in an hour – step by step
- SharePoint REST API: GET vs POST vs PUT vs DELETE vs PATCH
- Office 365: Understanding the hub site in SharePoint online

1 comments on “How to create hub site in SharePoint Online using PnP PowerShell?”
You must log in to post a comment.