pnp / PnP-PowerShell

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

Getting 'Access denied' when using New-PnPTermGroup #2664

Closed avluijk closed 4 years ago

avluijk commented 4 years ago

### Reporting an Issue or Missing Feature I'm trying to create new term groups by using PnP PowerShell.

### Expected behavior My admin account is Term Store Administrator (for several days now). First I connect to the tenant by using Connect-PnPOnline -Url https://tenant-admin.sharepoint.com. Then I use New-PnPTermGroup -Name Valo4-PreCheck to create a new term group.

### Actual behavior When executing the New-PnPTermGroup command, I get the following error message:

New-PnPTermGroup : Access denied. You do not have permission to perform this action or access this resource. At line:1 char:1

  • New-PnPTermGroup -Name Valo4-PreCheck
  • 
    + CategoryInfo          : WriteError: (:) [New-PnPTermGroup], ServerUnauthorizedAccessException
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Taxonomy.NewTermGroup

### Steps to reproduce behavior See the attached screenshots.

term_store_UI term_store_PS

In one (term_store_UI) you can see that my signed in account is Term Store Administrator and that I've succesfully created a term group using the UI. In the other (term_store_PS) you can see that I tried adding a term group in our test environment (csol) and in the environment of a customer (op). I used Connect-PnPOnline to connect to the tenant, used Get-PnPTenantSite to verify I have a working connection and then used New-PnPTermGroup to create a new term group. In our test environment I succeeded, in the customers enviroment I get the Access denied message.

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

### What is the version of the Cmdlet module you are running? 3.14.1910.1 (that's the version our partner Valo recommends us for installations and updates) I also tried it with the latest version, but that delivered the same problem.

### 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.

Rafaelki commented 4 years ago

Hi @avluijk, I am having a similar issue. Did you find any solution?

avluijk commented 4 years ago

Hi @Rafaelki, unfortunately not...

mikelind-SPK commented 4 years ago

Same problem here. CSOM is working fine in test-tenant with basic auth, but need to use PnP since basic auth is turned off in production tenant.

avluijk commented 4 years ago

@Rafaelki and @mikelind-SPK, I've found the solution! (With help from the experts at Valo.) You can find the solution on the following blog: https://www.koskila.net/how-to-fix-the-web-site-does-not-support-sharepoint-online-credentials-the-response-status-code-is-unauthorized-error/

This helped for me, so that's why I will close this issue.