HomeAbout Me
Microsoft 365
Groupify a SharePoint Online Site using PnP PowerShell
Simon Ågren
Simon Ågren
September 07, 2022
1 min

Table Of Contents

01
Example 1
02
Example 2
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.

Example 1

# Connect to the SharePoint Admin Site
Connect-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

Example 2

# Connect to the specific SharePoint site you want to groupify
Connect-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


Tags

sharepointpowershell
Previous Article
Groupify a SharePoint Online Site using PowerShell

Simon Ågren

CTA & Microsoft MVP

Solving business problems with tech

Expertise

Microsoft 365
Azure

Social Media

githubtwitterwebsite

Related Posts

Unveiling the Truth - Custom Sensitivity Label Colors
Unveiling the Truth - Custom Sensitivity Label Colors
March 01, 2024
2 min

Quick Links

About

Social Media