Create Permissions for SharePoint Online

This article provides instructions on how to create app permissions for SharePoint site by using PowerShell.

1. Install a PowerShell Module

Install-Module -Name PnP.PowerShell
Click to copy

2. Connect to SharePoint Site

Connect-PnPOnline https://tenantname.sharepoint.com/sites/siteName -Interactive
Click to copy

You will be prompted to enter the credentials including the second factor.

3. Grant the write Permission to Active Directory App

Grant-PnPAzureADAppSitePermission -AppId 'AzureAppIdwithSitesdotselectedpermission' -DisplayName 'App Name here' -Site 'https://tenantname.sharepoint.com/sites/sitename' -Permissions Write
Click to copy

4. Verify the Result