Before you run any SharePoint cmdlet, you have to connect SharePoint Administration center. To create a SharePoint Online Connection you must have SharePoint Online Administrator rights.

The Connect-SPOService cmdlet connects a SharePoint Online administrator or Global Administrator to the SharePoint Online Administration Center. Below are the ways to connect SharePoint administration Center:

$username = ""
$password = "password"
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist                             $userName, $(convertto-securestring $Password -asplaintext -force)
Connect-SPOService -Url -Credential $cred

Connect-SPOService -Url -credential

Connect-SPOService -Url