pnp / PnP-PowerShell

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

Get-PnPWeb results in 401 (Unauthorized) - Using MFA #2349

Open thuld opened 4 years ago

thuld commented 4 years ago

Reporting an Issue or Missing Feature

Reporting an issue

Expected behavior

Get web object of site-collection

Actual behavior

Error message:

Get-PnPWeb : The remote server returned an error: (401) Unauthorized.

Steps to reproduce behavior

I try to get the web-object using the following code:

$web = Get-PnPWeb -Connection (Connect-PnPOnline $url -ReturnConnection -UseWebLogin)

-UseWebLogin is used because we are using MFA

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

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

3.15.1911.0

How did you install the PnP-PowerShell Cmdlets?

ghost commented 4 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

FredrikThorn commented 4 years ago

I'm having the same issue.

Using Connect-PnPOnline -AppId "xxxx" -AppSecret "xxxx" -Url "https://tenant.sharepoint.com/sites/anysite"

And then Apply-PnPTenantTemplate gives error Apply-PnPTenantTemplate : The remote server returned an error: (401) Unauthorized

The App in Azure AD has the following API Permissions: image

//Fredrik