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

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

Set-SPOTenant -LegacyAuthProtocolsEnabled $True

 

Enjoy SharePoint Online.

 

 

%d Bloggern gefällt das: