I've followed these steps on technet but had no success: https://technet.microsoft.com/en-us/library/fp161372.aspx

PS Command:

Connect-SPOService -Url "https://<mydomain>-admin.sharepoint.com" -Credential "<myname>@<mydomain>.com"

After performed the command, I entered the password and got this error.

Connect-SPOService : Could not connect to SharePoint Online.

This is the instruction I followed:

Set up the SharePoint Online Management Shell environment for SharePoint Online global administrators Perform the following:

  • Install Windows PowerShell 3.0 from Windows Management Framework 3.0.
  • Install the SharePoint Online Management Shell from the Microsoft Download Center.
  • Click Start>All Programs>SharePoint Online Management Shell.
  • Run Connect-SPOService. For example, Connect-SPOService -Url https://contoso-admin.sharepoint.com -credential [email protected], where:
    • Url is the URL of the SharePoint Online Administration Center.
    • Credential is the user name to which you want to grant access to the SharePoint Online Administration Center site.
  • Try it out! For example, run Get-SPOSite to get a list of all sites.
  • 1
    Is your account global administrator? Aug 28, 2015 at 7:56
  • yes, it is a global adminsitrator. I thought my password was wrong. I even changed my password to ensure that it was correct.
    – user45499
    Aug 28, 2015 at 8:00
  • When I was able to connect, I didn't include the URL and credentials in quotations. Oct 22, 2018 at 16:37

3 Answers 3


When trying to administer SharePoint Online (O365) via PowerShell through a proxy server the Connect-SPOService cmdlet connections fail.

Perform these commands and retry Connect-SPOService

$cred = [System.Net.CredentialCache]::DefaultCredentials
[System.Net.WebRequest]::DefaultWebProxy.Credentials = $cred
  • too bad there is no -UseProxy switch for Connect-SPOService
    – JoeRod
    Jun 12, 2020 at 20:46

When we connect to SharePoint online Site, we need to connect to SharePoint Service first, where we give the Admin URL as below

Connect-SPOService -Url https://pasa365-admin.sharepoint.com

It will ask the user name and password, even if you are service admin you are good to connect, no need global admin to connect SharePoint admin Service

Then the SharePoint site comes in to Picture, once you connect to SharePoint Online Service you can connect to SharePoint site by below command

Get-SPOSite https://pasa365.sharepoint.com/sites/ITTeam

If you fail in First command saying "Connect-SPOService: The term 'Connect-SPOService' is not recognized as the name of a cmdlet, function, Then you need to install the SharePoint online PowerShell script SharePointOnlineManagementShell_8615-1200_x64_en-us by going to below URL and

try again. https://www.microsoft.com/en-us/download/details.aspx?id=35588

$cred = Get-Credential
[System.Net.WebRequest]::DefaultWebProxy.Credentials = $cred
Connect-SPOService -Url "https://<<siteName>>-admin.sharepoint.com" -Credential $cred

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.