Home
Sharepoint Powershell error: Cannot contact web site 'https://xxx-admin.sharepoint.com/' or the web site does not support SharePoint Online credentials.
Published: Tuesday, 23 July 2019 | Categories: Office365 | Keywords: Powershell, Sharepoint | Status: Posted | Created: Tuesday, 23 July 2019 | Author: paul

When executing Sharepoint Powershell commands it displays the error message below:

Cannot contact web site 'https://xxx-admin.sharepoint.com/' or the web site does not support SharePoint Online credentials. The response status code is 'Unauthorized'. The response headers are 'X-SharePointHealthScore=4, 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=15fef29e-9097-9000-086c-cbec360878c3, request-id=15fef29e-9097-9000-086c-cbec360878c3, MS-CV=nvL+FZeQAJAIbMvsNgh4ww.0, Strict-Transport-Security=max-age=31536000, SPRequestDuration=35, SPIisLatency=1, MicrosoftSharePointTeamServices=16.0.0.9110, X-Content-Type-Options=nosniff, X-MS-InvokeApp=1; RequireReadOnly, X-MSEdge-Ref=Ref A: B47BA0545E5149FFB5EC06EF89F8A484 Ref B: LON21EDGE1418 Ref C: 2019-07-23T07:21:04Z, Content-Length=0, Content-Type=text/plain; charset=utf-8, Date=Tue, 23 Jul 2019 07:21:03 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'.

This can be fixed by enabling legacy authentication in the tenant using the script below:

# Enable Legacy Auth for Sharepoint
Connect-SPOService -Url "https://xxx-admin.sharepoint.com"
$TenantSettings = Get-SPOTenant
$TenantSettings.LegacyAuthProtocolsEnabled
Set-SPOTenant -LegacyAuthProtocolsEnabled $True

 


Add Comment
No Comments.