pnp / powershell

PnP PowerShell
https://pnp.github.io/powershell
MIT License
679 stars 348 forks source link

[BUG] Set-PnPTenantSite -Url {siteURL} -SharingCapability ExternalUserSharingOnly command fails each time with a 401 Unauthorized error. #1002

Closed nganbui closed 3 years ago

nganbui commented 3 years ago

Reporting an Issue or Missing Feature

Set-PnPTenantSite -Url {siteURL} -SharingCapability ExternalUserSharingOnly worked before but now getting 401 Unauthorized error

Expected behavior

Set-PnPTenantSite -Url {siteURL} -SharingCapability ExternalUserSharingOnly command should succeed without error.

Actual behavior

Running cmdlets below Set-PnPTenantSite -Url {siteURL} -SharingCapability ExternalUserSharingOnly Getting the error Set-PnPTenantSite : The remote server returned an error: (401) Unauthorized.

Steps to reproduce behavior

Connect-PnPOnline -Tenant [tenantID] -ClientId [AppId] -Thumbprint [Thumprint] -Url "https://{abc}-admin.sharepoint.com" Set-PnPTenantSite -Url {siteURL} -SharingCapability ExternalUserSharingOnly

Note: LegacyAuth is tenant-wide disabled in our tenant

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

PnP.PowerShell version 1.7.0

Which operating system/environment are you running PnP PowerShell on?

fz8975 commented 3 years ago

Facing same issue while setting quota using Set-PnPSite

maheshkhiste commented 3 years ago

same thing ..Set-PnPSite command throwing (401) Unauthorized Error , we have automation using it , it was working fine until yesterday not sure what happened suddenly ? Any workarounds or standard MS Cmd which can used to set quota through Azure Functions ?

nganbui commented 3 years ago

I think changes pushed on 1.7.16-nightly to fix this bug. Try using PnP.PowerShell 1.7.16-nightly. It should work.

gautamdsheth commented 3 years ago

@nganbui - is it working with the latest nightly ?

fz8975 commented 3 years ago

@nganbui - is it working with the latest nightly ?

Yes it is working. But what caused this ?

gautamdsheth commented 3 years ago

It was fixed by this PR - https://github.com/pnp/powershell/pull/969

poi-radvine commented 3 years ago

@nganbui how comes this started being an issue exactly starting on Aug 1st? We have automations running and several Set-PnpSite Commands stopped working.

aungminko93750 commented 3 years ago

From: Gautam Sheth @.> Sent: Thursday, August 12, 2021 4:14:54 PM To: pnp/powershell @.> Cc: Subscribed @.***> Subject: Re: [pnp/powershell] [BUG] Set-PnPTenantSite -Url {siteURL} -SharingCapability ExternalUserSharingOnly command fails each time with a 401 Unauthorized error. (#1002)

@nganbuihttps://github.com/nganbui - is it working with the latest nightly ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/pnp/powershell/issues/1002#issuecomment-897478363, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATRCDA65HHCADIYCZOZBCBDT4OGI5ANCNFSM5B67GHWA.

poi-radvine commented 3 years ago

My issue was automatically resolved last week on tuesday. It probably has to do with changes in the backend. This raises the question on who is responsible for this? We raised a ticket at MSFT and it was closed (mostly bc. PNP is not supported) even though I explained it was not changing any modules or Powershell versions and happening on all our maintained tenants.

nganbui commented 3 years ago

@nganbui how comes this started being an issue exactly starting on Aug 1st? We have automations running and several Set-PnpSite Commands stopped working.

I don't know. I've found the issue on automation script using this cmdlet and raised the question on this community and informed that something changed on pnp modules that impacted the script so they suggested use the nightly version. This is third-party module so I don't think MS will support on any bug/issues.