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:

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

#Step: 1: Connect
Connect-SPOService -url "https://crescentintranet-admin.sharepoint.com"

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

On running 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://crescentintranet-admin.sharepoint.com” with “https://YOURDOMAIN-admin.sharepoint.com”.

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