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 - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world 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 *