Groupify a SharePoint Online Site using PnP PowerShell
This post will explore connecting a new Microsoft 365 group with an existing SharePoint Online site using PnP PowerShell. In a previous post, I explained how to do this using the SPO Management PowerShell modules.
In the PnP PowerShell module, we can use the Add-PnPMicrosoft365GroupToSite command to connect an existing site with a new Microsoft 365 group. Ensure that you have already installed the latest PnP PowerShell module. Before you start, run the below commands to connect the PnP PowerShell module with your SharePoint Online admin site.
# Connect to the SharePoint Admin SiteConnect-PnPOnline -Url https://<tenantname>-admin.sharepoint.com -Interactice# Groupify with a Site URL$siteUrl = "https://<tenantname>.sharepoint.com/sites/site1"$groupName = "Group1"$mailNickname = "Group1"Add-PnPMicrosoft365GroupToSite -Url $siteUrl -Alias $mailNickname -DisplayName $groupName
# Connect to the specific SharePoint site you want to groupifyConnect-PnPOnline -Url https://<tenantname>.sharepoint.com/sites/site1 -Interactice# Groupify the connected site$groupName = "Group1"$mailNickname = "Group1"Add-PnPMicrosoft365GroupToSite -Alias $mailNickname -DisplayName $groupName
Thank you for reading
/Simon