pnp / PnP-PowerShell

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

Connect-pnpOnline #2924

Open ajhawkins110 opened 4 years ago

ajhawkins110 commented 4 years ago

When trying to connect to a site via scheduled task or manually it fails to connect.

Command: Connect-PnPOnline $Url -Credentials $Credentials The error I receive is:

Connect-PnPOnline : The sign-in name or password does not match one in the Microsoft account system. At line:1 char:1

  • Connect-PnPOnline $Url -Credentials $Credentials
  • 
    + CategoryInfo          : NotSpecified: (:) [Connect-PnPOnline], IdcrlException
    + FullyQualifiedErrorId : Microsoft.SharePoint.Client.IdcrlException,PnP.PowerShell.Commands.Base.ConnectOnline

However if I run: Connect-PnPOnline $Url -UseWebLogin With the same username and password it works fine.

After doing some more digging, I don't believe the the request is being redirected correctly, like it is via UseWebLogin. We are not in a commercial office 365 tenant, but a .us

Azure is displaying this error:

Confidential Client requests are not supported on the public endpoint (login.microsoftonline.com) for tenants in the Azure Government cloud. Send your login requests to https://login.microsoftonline.us instead. Please see https://devblogs.microsoft.com/azuregov/azure-government-aad-authority-endpoint-update/ for more details

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

Online 3.25.2009.1

How did you install the PnP-PowerShell Cmdlets?