pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
990 stars 663 forks source link

New-PnPSite gives access-denied when using Device Login #1820

Open Koning53 opened 5 years ago

Koning53 commented 5 years ago

Reporting an Issue or Missing Feature

Issue

Expected behavior

New-PnPSite should create a new (Communication) Site

Actual behavior

New-PnPSite : The remote server returned an error: (401) Unauthorized

Steps to reproduce behavior

Connect-PnPOnline -url https://tenant-admin.sharepoint.com -LaunchBrowser:$false -PnPO365ManagementShell:$true New-PnPSite -Url https://tenant.sharepoint.com/sites/test -Type CommunicationSite -Title Test -Description Test -SiteDesign Blank

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

3.4.1812.2 (3.4.1812.0 introduced the issue)

How did you install the PnP-PowerShell Cmdlets?

The same command works in 3.3.1811.0.

mmsharepoint commented 5 years ago

The New-PnPSite respectively the underlying Api only supports LegacyAuthentication. So you cannot use -UseWeblogin or modern app authentication. In that case you receive the same error message so I am quite sure it's valid for your auth method, too, which I never used to be hinest.