Connect-PnPOnline not working

Silver Contributor

When I try to use Connect-PnPOnline, I get the following error. Why is it telling me that I need to browse to the website first?

 

The tenant uses ADFS, but when i add the -UseADFS attribute, i get an error stating Connect-PnPOnline : Endpoint does not use ADFS for authentication.

 

 

Connect-PnPOnline : Cannot contact web site 'https://tenant.sharepoint.com/' or the web site does not support SharePoint Online credentials.
The response status code is 'Unauthorized'. The response headers are 'X-SharePointHealthScore=0, X-MSDAVEXT_Error=917656;
Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically.,
SPRequestGuid=bc3d209e-80af-4000-920e-afece9bfd74d, request-id=bc3d209e-80af-4000-920e-afece9bfd74d, MS-CV=niA9vK+AAECSDq/s6b/XTQ.0,
Strict-Transport-Security=max-age=31536000, X-FRAME-OPTIONS=SAMEORIGIN, SPRequestDuration=46, SPIisLatency=1,
MicrosoftSharePointTeamServices=16.0.0.6927, X-Content-Type-Options=nosniff, X-MS-InvokeApp=1; RequireReadOnly, X-MSEdge-Ref=Ref A:
2ACE5D45C45544EF8E9E6ABD8F06C67A Ref B: BLUEDGE0809 Ref C: 2017-10-06T12:35:27Z, Content-Length=0, Content-Type=text/plain; charset=utf-8,
Date=Fri, 06 Oct 2017 12:35:27 GMT, P3P=CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE
PUR UNI", X-Powered-By=ASP.NET'.
At line:1 char:1
+ Connect-PnPOnline
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Connect-PnPOnline], NotSupportedException
    + FullyQualifiedErrorId : System.NotSupportedException,SharePointPnP.PowerShell.Commands.Base.ConnectOnline
@Erwin van Hunen 

5 Replies
If i change to -UseWebLogin, i get the prompts and seem to make a connection, but the ISE just locks up on me and I can't do anything. Has anyone else experienced this type of problem?

I had the issue of not login in a few months ago but had to do with MFA 

I haven't seen any problems myself but I wonder if you are going via a proxy on your network? that can create strange authentication weirdness. are you able to authenticate to o365 from powershell at all into the admin functions via the tenant login which is independent of the core.

also check that you have the latest PnP powershell engine as they may have made changes under the covers. it is released monthly.

Thanks for your suggestions. It fixed itself over the weekend :)

How did you solve the MFA situation Paul?