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.
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”.