PNP create a new list get 403 access denied
2023-03-20
Create a new list in SPO via PNPjs will get 403 access denied, run this script to solve it
$AdminSiteURL='https://quantr-admin.sharepoint.com';
$SiteURL='https://quantr.sharepoint.com/sites/QIv1';
#Get Credentials to connect
$Cred = Get-Credential
#Connect to SharePoint Online Tenant Admin
Connect-SPOService -URL $AdminSiteURL -Credential $Cred
#Disable DenyAddAndCustomizePages Flag
Set-SPOSite $SiteURL -DenyAddAndCustomizePages 0