pnp / PnP-PowerShell

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

Connect-PnPOnline: ParameterSet for ClientId/ClientSecret cannot be resolved #2829

Open NinjaSciurus opened 4 years ago

NinjaSciurus commented 4 years ago

Reporting an Issue or Missing Feature

Trying to connect to SPO using the Connect-PnPOnline -Url <String> -ClientSecret <String> -ClientId <String> parameter set fails because the parameter set cannot be resolved in spite of documentation.

Expected behavior

A successfull connection is being established or some connection-specific error message occurs.

Actual behavior

The error message Parameter set cannot be resolved using the specified named parameters. is being displayed and no connection is established.

Steps to reproduce behavior

Install SharePointPnPPowerShell2019, Version 3.23.2007.1. (Note: since opening the issue we've moved to 3.25.2009.1 and it's producing the same error.) Execute Connect-PnPOnline -Url <String> -ClientSecret <String> -ClientId <String> using existing and correct values for the Url, ClientId and ClientId parameters.

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

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

3.23.2007.1

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.

markgort86 commented 4 years ago

Within version 3.24.2008.0 this command in working fine on my end when connecting with SharePoint Online. Can you try to update this command with the newest module?

crisghita commented 4 years ago

I have the same issue (with 3.24.2008.0):

PS > Get-Module SharePointPnPPowerShell2019 | Select Name,Version

Name                        Version    
----                        -------    
SharePointPnPPowerShell2019 3.24.2008.0

PS > Connect-PnPOnline -Url $sharePointUrl -ClientID $clientId -ClientSecret $clientSecret
Connect-PnPOnline : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Connect-PnPOnline -Url $sharePointUrl -ClientID $clientId -ClientSecr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Connect-PnPOnline], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,PnP.PowerShell.Commands.Base.ConnectOnline
grunernakhter commented 3 years ago

Any updates on this issue? Having the same problem from Azure Function App...

NinjaSciurus commented 3 years ago

We now moved to v3.25.2009.1 - still the same output:

PS C:\Users\developer> Connect-PnPOnline ##### -ClientId ##### -ClientSecret #####
Connect-PnPOnline : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Connect-PnPOnline ##### ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Connect-PnPOnline], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,PnP.PowerShell.Commands.Base.ConnectOnline

PS C:\Users\developer> Get-Module SharePointPnPPowerShell2019 | select version

Version
-------
3.25.2009.1

Any updates on this? Is there any workaround we can implement?

Please not that everything works fine with the SharePointPnPPowerShellOnline module but since we're in a hybrid environment where we also need to support a SharePoint Server 2019 installation we cannot simply ditch the SharePointPnPPowerShell2019 module.