Connect-PnPOnline not working

%3CLINGO-SUB%20id%3D%22lingo-sub-114190%22%20slang%3D%22en-US%22%3EConnect-PnPOnline%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-114190%22%20slang%3D%22en-US%22%3E%3CP%3EWhen%20I%20try%20to%20use%20Connect-PnPOnline%2C%20I%20get%20the%20following%20error.%20Why%20is%20it%20telling%20me%20that%20I%20need%20to%20browse%20to%20the%20website%20first%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20tenant%20uses%20ADFS%2C%20but%20when%20i%20add%20the%20-UseADFS%20attribute%2C%20i%20get%20an%20error%20stating%26nbsp%3BConnect-PnPOnline%20%3A%20Endpoint%20does%20not%20use%20ADFS%20for%20authentication.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EConnect-PnPOnline%20%3A%20Cannot%20contact%20web%20site%20'%3CA%20href%3D%22https%3A%2F%2Ftenant.sharepoint.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftenant.sharepoint.com%2F%3C%2FA%3E'%20or%20the%20web%20site%20does%20not%20support%20SharePoint%20Online%20credentials.%3CBR%20%2F%3EThe%20response%20status%20code%20is%20'Unauthorized'.%20The%20response%20headers%20are%20'X-SharePointHealthScore%3D0%2C%20X-MSDAVEXT_Error%3D917656%3B%3CBR%20%2F%3EAccess%2Bdenied.%2BBefore%2Bopening%2Bfiles%2Bin%2Bthis%2Blocation%252c%2Byou%2Bmust%2Bfirst%2Bbrowse%2Bto%2Bthe%2Bweb%2Bsite%2Band%2Bselect%2Bthe%2Boption%2Bto%2Blogin%2Bautomatically.%2C%3CBR%20%2F%3ESPRequestGuid%3Dbc3d209e-80af-4000-920e-afece9bfd74d%2C%20request-id%3Dbc3d209e-80af-4000-920e-afece9bfd74d%2C%20MS-CV%3DniA9vK%2BAAECSDq%2Fs6b%2FXTQ.0%2C%3CBR%20%2F%3EStrict-Transport-Security%3Dmax-age%3D31536000%2C%20X-FRAME-OPTIONS%3DSAMEORIGIN%2C%20SPRequestDuration%3D46%2C%20SPIisLatency%3D1%2C%3CBR%20%2F%3EMicrosoftSharePointTeamServices%3D16.0.0.6927%2C%20X-Content-Type-Options%3Dnosniff%2C%20X-MS-InvokeApp%3D1%3B%20RequireReadOnly%2C%20X-MSEdge-Ref%3DRef%20A%3A%3CBR%20%2F%3E2ACE5D45C45544EF8E9E6ABD8F06C67A%20Ref%20B%3A%20BLUEDGE0809%20Ref%20C%3A%202017-10-06T12%3A35%3A27Z%2C%20Content-Length%3D0%2C%20Content-Type%3Dtext%2Fplain%3B%20charset%3Dutf-8%2C%3CBR%20%2F%3EDate%3DFri%2C%2006%20Oct%202017%2012%3A35%3A27%20GMT%2C%20P3P%3DCP%3D%22ALL%20IND%20DSP%20COR%20ADM%20CONo%20CUR%20CUSo%20IVAo%20IVDo%20PSA%20PSD%20TAI%20TELo%20OUR%20SAMo%20CNT%20COM%20INT%20NAV%20ONL%20PHY%20PRE%3CBR%20%2F%3EPUR%20UNI%22%2C%20X-Powered-By%3DASP.NET'.%3CBR%20%2F%3EAt%20line%3A1%20char%3A1%3CBR%20%2F%3E%2B%20Connect-PnPOnline%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20CategoryInfo%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3A%20NotSpecified%3A%20(%3A)%20%5BConnect-PnPOnline%5D%2C%20NotSupportedException%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20FullyQualifiedErrorId%20%3A%20System.NotSupportedException%2CSharePointPnP.PowerShell.Commands.Base.ConnectOnline%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F122%22%20target%3D%22_blank%22%3E%40Erwin%20van%20Hunen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-114190%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-152774%22%20slang%3D%22en-US%22%3ERe%3A%20Connect-PnPOnline%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-152774%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20did%20you%20solve%20the%20MFA%20situation%20Paul%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-119215%22%20slang%3D%22en-US%22%3ERe%3A%20Connect-PnPOnline%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-119215%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20your%20suggestions.%20It%20fixed%20itself%20over%20the%20weekend%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-119117%22%20slang%3D%22en-US%22%3ERe%3A%20Connect-PnPOnline%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-119117%22%20slang%3D%22en-US%22%3EI%20haven't%20seen%20any%20problems%20myself%20but%20I%20wonder%20if%20you%20are%20going%20via%20a%20proxy%20on%20your%20network%3F%20that%20can%20create%20strange%20authentication%20weirdness.%20are%20you%20able%20to%20authenticate%20to%20o365%20from%20powershell%20at%20all%20into%20the%20admin%20functions%20via%20the%20tenant%20login%20which%20is%20independent%20of%20the%20core.%3CBR%20%2F%3E%3CBR%20%2F%3Ealso%20check%20that%20you%20have%20the%20latest%20PnP%20powershell%20engine%20as%20they%20may%20have%20made%20changes%20under%20the%20covers.%20it%20is%20released%20monthly.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-119003%22%20slang%3D%22en-US%22%3ERe%3A%20Connect-PnPOnline%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-119003%22%20slang%3D%22en-US%22%3E%3CP%3EI%20had%20the%20issue%20of%20not%20login%20in%20a%20few%20months%20ago%20but%20had%20to%20do%20with%20MFA%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-118706%22%20slang%3D%22en-US%22%3ERe%3A%20Connect-PnPOnline%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-118706%22%20slang%3D%22en-US%22%3EIf%20i%20change%20to%20-UseWebLogin%2C%20i%20get%20the%20prompts%20and%20seem%20to%20make%20a%20connection%2C%20but%20the%20ISE%20just%20locks%20up%20on%20me%20and%20I%20can't%20do%20anything.%20Has%20anyone%20else%20experienced%20this%20type%20of%20problem%3F%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Respected 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?