Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Add-PnPTeamsTeam throwing Authentication Method is not allowed #462

Closed
1 of 6 tasks
prawnz opened this issue Mar 19, 2021 · 5 comments
Closed
1 of 6 tasks

[BUG] Add-PnPTeamsTeam throwing Authentication Method is not allowed #462

prawnz opened this issue Mar 19, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@prawnz
Copy link

prawnz commented Mar 19, 2021

Reporting an Issue or Missing Feature

I am using a certificate authentication method which is created using the Register-PnPAzureADApp with Connect-PnPOnline. When I try to user Add-PnPTeamsTeam with a modern team site is created using New-PnPSite -Type "TeamSite" -Title $siteTitle -Alias $groupAlias -IsPublic -Wait

I am getting Authentication method not allowed as shown
[DBG]: PS C:\Projects\DOF-M365Provisioning> Add-PnPTeamsTeam
Add-PnPTeamsTeam: {"odata.error":{"code":"10005","message":{"lang":"en-US","value":"Authentication method is not allowed."}}}

Expected behavior

I am expecting the Add-PnpTeamsTeam cmdlet to complete.

Steps to reproduce behavior

Connect-PnPOnline -URL "https://$($tenantName)-admin.sharepoint.com" -ClientId $appRegistrationClientIdValue -Thumbprint $certThumbprintValue -Tenant $tenantIdValue
$tenantSite = New-PnPSite -Type "TeamSite" -Title $siteTitle -Alias $groupAlias -IsPublic -Wait
$tenantSiteUrl = $($tenantSite.Url)
Connect-PnPOnline -URL $tenantSiteUrl -ClientId $appRegistrationClientIdValue -Thumbprint $certThumbprintValue -Tenant $tenantIdValue
Add-PnPTeamsTeam

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

PnP.Powershell 1.4.0

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

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@prawnz prawnz added the bug Something isn't working label Mar 19, 2021
@erwinvanhunen erwinvanhunen self-assigned this Mar 19, 2021
@gautamdsheth gautamdsheth self-assigned this Mar 31, 2021
@gautamdsheth
Copy link
Collaborator

@prawnz - This is a known issue for app-only context. You can use this command only with delegated permissions and user context due to limitations of SharePoint APIs.

If you wish you use app-only context, would suggest that you use

New-PnPMicrosoft365Group cmdlet and use -CreateTeam parameter. It does the same thing but uses Graph endpoints which support app-only scenarios.

@prawnz
Copy link
Author

prawnz commented Mar 31, 2021

@gautamdsheth all good.. will use your suggested method.

@TheHailender
Copy link

@gautamdsheth all good.. will use your suggested method.

When I try to use New-PnPMicrosoft365Group with the parameter -CreateTeam I get this error

Failed
Empty Payload. JSON content expected. (Empty Payload. JSON content expected.)

But the O365 group and teamsite is created correctly.
I use the command in an Azure RunBook with the PnP PowerShell Version 1.4.0.

@TheHailender
Copy link

uuh sorry, an update to 1.5.0 solves the problem

@mohandivraniya
Copy link

I am facing the same issue with PnP.PowerShell version 1.5.0

I have added all the details in this issue

gautamdsheth added a commit that referenced this issue Aug 13, 2021
* Downgraded dependencies to handle Az DLLs

* Fix #916 - added PnP alias for commands

* Added SiteAlias for New-PnPSite, Principals for PnPHubSite

* Updated docs

* Fixed output for hub site registration.

* Fix #990 - fix for odata.nextLink issue

* #840 - added NoCrawl parameter to disable SPList indexing

* Docs update

* #1007 - fix for Add-PnPTeamsTeam issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants