pnp / PnP-PowerShell

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

Apply-PnPTenantTemplate fails when MFA is enabled. #2584

Open mjarmstrong opened 4 years ago

mjarmstrong commented 4 years ago

Reporting an Issue or Missing Feature

Apply-PnPTenantTemplate does not work when MFA is enabled It returns "Apply-PnPTenantTemplate : The remote server returned an error: (403) Forbidden."

User authenticating is a global admin.

Expected behavior

Tenant template is applied.

Actual behavior

"Apply-PnPTenantTemplate : The remote server returned an error: (403) Forbidden." - when MFA is enabled.

Steps to reproduce behavior

Connect-PnPOnline -Url "https://tenant.sharepoint.com" -UseWebLogin Apply-PnpTenantTemplate -path tenant.xml

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

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

(you can retrieve this by executing Get-Module -Name *pnppowershell* -ListAvailable) Binary 3.19.20... SharePointPnPPowerShellOnline Binary 3.18.20... SharePointPnPPowerShellOnline

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.

Andy-Dawson commented 4 years ago

I am also seeing this issue. The cmdlet works fine on a tenant on which MFA is not enabled. I am also attempting to run this as a global tenant admin and seeing the same (403) Forbidden error.

cmzaragoza commented 4 years ago

Same problem here. The only workaround afaik, is registering an application and using client id and secret.