Replies: 2 comments
-
Are you working with the same versions of PowerShell and also PnP on the workstation and the server running the scripts? |
Beta Was this translation helpful? Give feedback.
-
Yes - same versions. When using the -Interactive, it is puzzling that it works on some sites, but not all. It appears to be a site setting issue, but I can't find any differences in the site settings or permissions. I checked the sign-in logs of the Enterprise App for the PNP Powershell. I see the connection successful and then a failure: There is no failures in CA tab of the sign-in log or authentication. Just for fun, I exempted the Pnp Powershell ent. app or temporarily disabled any CAP's that could be impacting it. But that did not change the results. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We are trying to change our PS scripts to use -Interactive with Connect-PNPOnline instead of using the -UseWeblogin, since the later now gives "browser not supported" errors.
Most scripts require just that simple change and work fine. We have several scripts that access lists in https://(our SP tenant url)/sites/MainSite that we have change and work.
However, some sites get an error on the Get-PnpSite command "Get-PnPSite: Attempted to perform an unauthorized operation.". I know I have permissions to the site. If I run from my workstation and use -UseWeblogon it works. But if I run from a server (using same credentials), it fails.
We also have a subsite https://(our SP tenant url)/sites/MainSite/SubSite. Changing to -Interactive works for the main site, but is NOT working for the subsite. When I attempt to Get-PNPList or Get-PNPListItem the error "Get-PnPList: Attempted to perform an unauthorized operation." comes up. I have full rights to the site and to the list. The same users who were successful with -UseWeblogin (before that broke), also get the unauthorized error message when trying to use -Interactive.
Any help in figuring out why we are getting the error would be very much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions