Cannot create list or add site column using PNP PowerShell

Copper Contributor



I have a development tenant where I am SharePoint Administrator. 

I want to create some site columns, content types and lists, on a specific site, so I am using PnP PowerShell.

When I run the command 

  • New-PnPList -Title testList -Template GenericList

I get the following error


I'm a site collection administrator, but SharePoint won't assume my permissions.

I have tried the same actions on 2 other development tenants and a production tenant and I can perform the actions I want, this issue only occurs on this particular office 365 developer tenant. 


PowerShell Code:

  • Connect-PnPOnline -Url {SITEURL}
  • $web = Get-PnPWeb
  • $currentUser = $web.CurrentUser
  • $web.Context.Load($currentUser)
  • $web.Context.ExecuteQuery()
  • $web
  • New-PnPList -Title testList -Template GenericList



Bellow I show some images confirming my statements.




5 Replies
I'm guessing you are using legacy auth,

try this:

Connect-PnPOnline -Url "YourSite" -Interactive
New-PnPList -Title testList -Template GenericList

@NicolasKheirallahI had already tried your solution and even so I can't carry out the creation, on this site, from this specific development tenant. In others I can

Have you tried in another site? does it work there?
I tried on 3 or 4 different sites in this tenant and I couldn't do this action using PowerShell, even on a new site, created from scratch for this test. After that I tried it on 2 different tenants and it worked
best response confirmed by duarte_Aguiar (Copper Contributor)

Hi everyone, I asked this question on another forum and using Connect-PnPOnline -Url{site url} -UseWebLogin I was able to do the creations.
Thank you very much