Open Carlos-35 opened 5 years ago
Hello. Any update on this? I am also getting the error:
Set-PnPSite : The remote server returned an error: (403) Forbidden
Currently I am running this version "SharePointPnPPowerShellOnline\3.9.1905.3"
I have the same issue. Any Updates on this?
I have the same issue but I think I found the behavior. I used -UseWeblogin and I got the 403 Access denied. But when I used the regular connect-pnponline, it worked without error.
I was able to use "Set-PnPSite -DisableFlows" when I used an account with SharePoint Administrator role or an account with site collection administrator access on the SharePoint Admin site.
In the Set-PnPSite code it accesses the majority of the site's properties by using the SharePoint Admin site context.
Hi guys,
I got a 401 error everytime I used the Set-PnPSite command. When viewing the request through fiddler I noticed that the rest request was posted to the tenant admin sitecollection.
So using the following code, I am now able to use Set-PnpSite:
Connect-PnPOnline -Url "https://tenant-admin.sharepoint.com" -AppId $appId -AppSecret $appSecret
Set-PnPSite -Identity "https://tenant.sharepoint.com/sites/site1" -DisableSharingForNonOwners
Hope this helps for you as well!
One would say this would belong in Set-PnPTenantSite.
Using version 3.15.19 of PnP Powershell.
I found no solution for the 403 error so I use a direct CSOM call to disable flow:
Write-Message -MessageType Activity -Message ("Disabling Flow in site '{0}'" -f $siteUrl)
$ctx = Get-PnPContext
$ctx.Site.DisableFlows = $true
$ctx.ExecuteQuery()
I haven't tried the PNP cmdlet parameter in the last couple of month maybe the error is fixed in the meantime. But if not you can use the code above to configure the site.
This still an issue on version 3.21.2005.1 I can do it via the CSOM as reported above (@Bernd-Spieth ) but it would be good to get that solved
Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:
Apply-SPOProvisioningTemplate
orGet-SPOProvisioningTemplate
? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/officedev/PnP-Sites-Core/issues.Reporting an Issue or Missing Feature
Issue
Expected behavior
I want to disable Flow and Sharing for non owners. So I use Set-PNPSite with the Parameters -DisableSharingForNonOwners and -DisableFlows.
Actual behavior
Both commands throw the same error: The remote server returned an error (403) forbidden
Steps to reproduce behavior
Which version of the PnP-PowerShell Cmdlets are you using?
What is the version of the Cmdlet module you are running?
3.5.1901.0
How did you install the PnP-PowerShell Cmdlets?