Fix “No connection available. Use Connect-SPOService before running this CmdLet.” Error in SharePoint Online PowerShell!

Problem: Getting this error, “No connection available. Use Connect-SPOService before running this CmdLet.” while trying to connect SharePoint Online via PowerShell through SharePoint Online Management Shell.

No connection available. Use Connect-SPOService before running this CmdLet.

Solution:

You must connect to SharePoint Online Service using Connect-SPOService PowerShell cmdlet first before executing any other cmdlets for SharePoint Online.

#Step: 1: Connect to SharePoint Online
Connect-SPOService -url "https://Crescent-admin.sharepoint.com"

#Step 2: Run Cmdlet for SharePoint Online
Get-SPOUser -Site "https://Crescent.sharepoint.com/sites/marketing"

On running the Connect-SPOService cmdlet, you’ll be prompted to enter credentials. On a successful connection, You can proceed with running desired cmdlets. Don’t forget to replace the Tenant admin URL “https://Crescent-admin.sharepoint.com” with “https://YOURDOMAIN-admin.sharepoint.com”.

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

One thought on “Fix “No connection available. Use Connect-SPOService before running this CmdLet.” Error in SharePoint Online PowerShell!

  • Many thanks ! worked for me

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *