Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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] Connect-PnPOnline not working using a service principal #4641

Closed
1 of 6 tasks
jay-dee-20 opened this issue Dec 19, 2024 · 1 comment
Closed
1 of 6 tasks

[BUG] Connect-PnPOnline not working using a service principal #4641

jay-dee-20 opened this issue Dec 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jay-dee-20
Copy link

Notice

Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:

  1. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.

I am trying to use:

$connection = Connect-PnPOnline -Url $destinationUrl -ClientId $clientId -ClientSecret $clientSecret -Tenant $tenantId

And get the error:

Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided.

The documentation I've seem seems to indicate this is all that is needed, so I'm wondering if this is a bug?

Reporting an Issue or Missing Feature

Please confirm what it is that your reporting

Expected behavior

Please describe what output you expect to see from the PnP PowerShell Cmdlets

Actual behavior

Please describe what you see instead. Please provide samples of output or screenshots.

Steps to reproduce behavior

Please include complete script or code samples in-line or linked from gists

$installed = Get-Module -Name PnP.PowerShell -ListAvailable
If (!$installed) { Install-Module PnP.PowerShell }
Import-Module PnP.PowerShell

$destinationUrl = "<SP Site URL>" 
$clientId = "<client ID>"
$clientSecret = "<client secret>"
$tenantId = "<tenant ID>"

$connection = Connect-PnPOnline -Url $destinationUrl -ClientId $clientId -ClientSecret $clientSecret -Tenant $tenantId

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

(you can retrieve this by executing Get-Module -Name "PnP.PowerShell" -ListAvailable)

2.12.0

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

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@jay-dee-20 jay-dee-20 added the bug Something isn't working label Dec 19, 2024
@jackpoz
Copy link
Contributor

jackpoz commented Dec 20, 2024

Try without -Tenant parameter, that seems to work for me:

image

@pnp pnp locked and limited conversation to collaborators Dec 24, 2024
@gautamdsheth gautamdsheth converted this issue into discussion #4648 Dec 24, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants