SharePoint Hub Sites is a handy way to organize the intranet since you can associate sites together in a hub site and benefit from advantages such as:
- Cross-site navigation: Common navigation that appears on all associated sites
- Content rollup: Access to news and activities from associated sites
- Consistent look and feel: Common theme across associated sites
- Scoped search: Search across all associated sites
In this blogpost, I will show you different advantages you get when working with hub sites. I also will demonstrate to you how to register and manage SharePoint hub sites.
Important: You may need to update your SharePoint Online Management Shell to the version 16.0.7521.1200 or later, in order to use the demonstrated PowerShell commands below.
- Register a site as a hub site
- Manage access to hub site associations
- Associate a site with a hub site
- Migrate an associated site to another hub site
- Trying out the hub site’s benefits
1. Register a site as a hub site
Hub sites are created based on existing sites. There are two recommended kinds of sites which SharePoint supports to be registered as a hub site:
- Communication Site
- Group/Modern Site
A classic site can also be registered as a hub site. However, because of the classic site’s limitations, the hub site navigation and hub site settings will only appear on modern pages, including document libraries, lists and site contents when the new experience is activated. So, you could define a modern page as the homepage of your classic site in order to have easier access to the missing components. Here is what the hub site settings button looks like:
Unfortunately, it’s not possible to register a hub site directly from the SharePoint UI yet. For that reason, you must work with a solution which supports this SharePoint API _api/site/RegisterHubSite. The code below shows how to use PowerShell to register an existing site as a hub site:
The property Principals plays an important role in registering hub sites since it gives the specified users the rights to manage the hub site. It means that only these users can:
- edit hub site settings
- associate a site with a hub site
Leaving this property empty results in a scenario where everyone has permission to manage the hub site, since it is public by default.
Important: You can’t register more than 50 hub sites in your tenant.
2. Manage access to hub site associations
If you didn’t set up permissions during the process of registering a hub site, you can restrict the access later so that only specified users can associate sites with a hub site. The code below shows how to use PowerShell to allow the user Master to associate his sites with the Project Alice hub site:
The specified user must be a site collection administrator in the sites he wants to associate with a hub site. Otherwise, he won’t have access to the Hub Site Association property which allows him to set up the site association using the SharePoint UI. Here is how it looks:
Of course, you can also revoke permissions so that specified users will no longer be able to associate sites with a hub site. The PowerShell code below reaches this goal:
3. Associate a site with a hub site
The following SharePoint site types can be associated with a hub site:
- Communication sites
- Group/Modern sites
- Classic sites
- Team’s modern site which is behind the scenes
To associate a site with a hub site, you can either use the SharePoint UI (as demonstrated in step 2 of this blog post) or you can use the SharePoint API /_api/site/JoinHubSite(hubSiteId). The PowerShell code below demonstrates how to associate the site Marketing with the hub site Project Alice:
Important: You can’t associate a hub site with another hub site.
4. Migrate an associated site to another hub site
SharePoint sites can’t be associated with multiple hub sites at the same time. Migrating already associated sites is as easy as associating sites for the first time. The only thing you need is to run the SharePoint API /_api/site/JoinHubSite(hubSiteId) again. This transforms your intranet into a dynamic digital workplace.
Running the PowerShell command Add-SPOHubSiteAssociation as demonstrated in the step 3 migrates an already associated site to another hub site.
5. Trying out the hub site’s benefits
Some of the functionalities below are gradually introduced to organizations. Perhaps you may not see these features working on your tenant yet.
Important: Some changes (e.g. theme, hub site logo etc.) can take very long (more than 1 hour) until they are rolled out to all associated sites.
5.1. Cross-site navigation: Common navigation that appears on all associated sites
When I started trying hub sites, I thought that sites were automatically added to the global navigation when they are associated with the hub site, but this is not what happens!
The global navigation is unique across all sites from the hub and it can be edited depending on your needs. The picture below shows this feature in an associated site:
5.2. Content rollup: Access to news and activities from associated sites
By using default SharePoint Framework web parts, the hub site’s homepage can be configured to give users access to content from all sites in the hub. For instance:
- News web part: See news from associated sites
- Sites web part: Overview of all sites in the hub
- Site activity web part: See what happen in your associated sites (It didn't work during my tests)
5.3. Consistent look and feel: Common theme across associated sites
Consistent theme through all sites in the hub. To roll out a new theme to your associated sites, you just need to change the look of your hub site J
5.4. Scoped search: Search across all associated sites
For instance, searching for “sites” returns all the sites which are associated with my HR hub site. Here is how it looks in my environment:
The learning curve of working with hub sites is low because you use default SharePoint components that you’ve used in the past. For instance, searching for content across associated sites means triggering a search request from the hub site. Having access to news from associated sites means configuring the News web part in the hub site. It’s just about working with things that you already know.
SharePoint administrators benefit from simple PowerShell cmdlets to manage the hub sites. In this blog post I’ve just demonstrated a couple of PowerShell cmdlets. Check out this page to see all the supported cmdlets that are available for managing hub sites with PowerShell.
I know that hub sites are still under development, but there are already a couple of things that I’d like to have in the future:
- Capability of registering hub sites using the SharePoint UI. For instance, through the Central Administration
- Overview of existing hub sites
- Overview of associated sites with a hub site
It’s amazing how fast Microsoft has been releasing new features in Office 365. Microsoft’s cloud strategy makes the work with SharePoint very pleasurable.