Skip to content

Commit 41e7ec5

Browse files
authored
Update documentation and add required permissions for Add-PnPMicrosoft365GroupToSite cmdlet (#5186)
1 parent f9c5dad commit 41e7ec5

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

documentation/Add-PnPMicrosoft365GroupToSite.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ title: Add-PnPMicrosoft365GroupToSite
1313

1414
**Required Permissions**
1515

16-
* SharePoint: Access to the SharePoint Tenant Administration site
16+
* SharePoint: Access to the SharePoint Tenant Administration site + SharePoint site collection admin
17+
* SharePoint permissions: `Sites.FullControl.All` (application) or `AllSites.FullControl` (delegated)
18+
* Ensure the user/account is allowed to create Microsoft 365 Groups (tenant policy), has access to SharePoint admin site and is site collection admin of the site to be groupified.
1719

1820
Groupifies a classic team site by creating a Microsoft 365 group for it and connecting the site with the newly created group.
1921

src/Commands/Admin/AddMicrosoft365GroupToSite.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
using System.Management.Automation;
66
using System;
77

8+
using PnP.PowerShell.Commands.Attributes;
9+
810
namespace PnP.PowerShell.Commands.Admin
911
{
1012
[Cmdlet(VerbsCommon.Add, "PnPMicrosoft365GroupToSite")]
11-
public class AddMicrosoft365GroupToSite: PnPSharePointOnlineAdminCmdlet
13+
[RequiredApiApplicationPermissions("sharepoint/Sites.FullControl.All")]
14+
[RequiredApiDelegatedPermissions("sharepoint/AllSites.FullControl")]
15+
public class AddMicrosoft365GroupToSite : PnPSharePointOnlineAdminCmdlet
1216
{
1317
[Parameter(Mandatory = false)]
1418
public string Url;
@@ -38,7 +42,7 @@ public class AddMicrosoft365GroupToSite: PnPSharePointOnlineAdminCmdlet
3842
public string[] Owners;
3943

4044
protected override void ExecuteCmdlet()
41-
{
45+
{
4246
var groupifyInformation = new TeamSiteCollectionGroupifyInformation()
4347
{
4448
Alias = Alias,

0 commit comments

Comments
 (0)