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

In this post, I will explain how to programmatically connect an existing top-level SharePoint Online site to a new Microsoft 365 Group using PowerShell, using the Set-SPOSiteOffice365Group PowerShell command. Before proceeding, install the SharePoint Online PowerShell module and run the following commands:

# Connect to SharePoint Service
Connect-SPOService -Url "https://<yourtenant>-admin.sharepoint.com"

This example creates a new Microsoft 365 Group named “Group1” and connects the site collection to it. The group will have its privacy set to “Private”

$siteUrl = "https://<yourtenant>.sharepoint.com/sites/site1"
$groupName = "group1"
$mailNickname = "group1"
Set-SPOSiteOffice365Group -Site $siteUrl -DisplayName $groupName -Alias $mailNickname

Thank you for reading
/Simon


Tags

sharepointpowershell
Previous Article
A learn more link for sensitivity labels

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