Fix “Connect-SPOService : Could not connect to SharePoint Online.” Error

Problem: When trying to connect o SharePoint Online using the Connect-SPOService cmdlet, got this error message, “Connect-SPOService : Could not connect to SharePoint Online.”

Connect-SPOService : Could not connect to SharePoint Online


1. Make sure the given tenant admin URL is correct, and your system is able to connect to the Tenant admin site! Just try to open the Tenant admin site: https://<your-tenant> in the web browser. (E.g. or “” would end up in error!)

2. If you are besides proxy server, add these two lines prior t connect SharePoint Online:

#Setup Proxy
$Credentials = [System.Net.CredentialCache]::DefaultCredentials
[System.Net.WebRequest]::DefaultWebProxy.Credentials = $Credentials

#Connect to SharePoint Online 
Connect-SPOService -url ""

3. If you have access control enabled in SharePoint or Office 365 (E.g. “Allow only specific IPs”, Intune Policy, etc.), You won’t be able to connect to SharePoint Online when you are outside the access control rules.

4. If you get errors something like “Connect-SPOService : Could not authenticate to SharePoint Online using OAuth 2.0”, that means the protocol you have provided for the tenant admin could be wrong! (E.g. “”, “”, etc.) It should be HTTPS instead of HTTP. Or the provided credentials are invalid.

Related post: Fix Connect-SPOService : The term ‘Connect-SPOService’ is not recognized as the name of a cmdlet, function, script file, or operable program

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply