Cannot connect to SharePoint Online with PowerShell

SharePointProblem:

When you try to connect to SharePoint Online using PowerShell, you receive an Access Denied error as follows:

PS C:\> Connect-SPOService -Url https://tenant-admin.sharepoint.com -credential $credential 

Connect-SPOService : Cannot contact web site'https://tenant-admin.sharepoint.com/' or the web site does not supportSharePoint Online credentials. The response status code is 'Unauthorized'. Theresponse headers are 'X-SharePointHealthScore=0,SPRequestGuid=310ce59d-002b-3000-ef1a-70e5fe7eaf72,request-id=310ce59d-002b-3000-ef1a-70e5fe7eaf72, 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.,

Solution

Connect to the SPO Service without the previously entered credentials ($credential) and enable the LegacyAuthProtocolsEnabled attribute.

Set-SPOTenant -LegacyAuthProtocolsEnabled $True

Enjoy SharePoint Online.

Kurz-URL | Short URL: https://granikos.eu/go/nILh

Entdecke mehr von Granikos GmbH & Co. KG

Jetzt abonnieren, um weiterzulesen und auf das gesamte Archiv zuzugreifen.

Weiterlesen