Official Site

Konstantinos Boutsioulis

Microsoft Most Valuable Professional M365 Apps & Services

Microsoft Most Valuable Professional Business Applications

Consultant & Sr Cloud Solution Architect Modern Wokrplace

Free Material

Find hereMore than 150 Articles about Microsoft Technologies on Modern Workplace

Create Site Hub Association in SharePoint Online Using PowerShell

30 June 2023

In today's article I will show you how we can create a hub association between a site and a hubsite in our tenant using PowerShell First we select which site we want to get a connection to a hub site and the hub site which will be connected to that site

In the next step we run the following PowerShell from the SharePoint Management Shell with administrator privileges

Code In PnP

# Declare Variables

$Site="https://mytenant-admin.sharepoint.com"

#Connect with PnP Online

Connect-PnPOnline -Url $Teanant -Interactive

#Execute Connect with hub site

Add-SPOHubSiteAssociation https://mytenant.sharepoint.com/sites/NewDemo -HubSite https://mytenant.sharepoint.com

As you can see the Powershell was executed successfully and finally as we can see from the SharePoint Admin Center the specific association between the two sites has been made

#SharePoint #technology #microsoft #PowerShell #PnP #digitaltransformation #cloud #mvpbuzz #m365