You must be a Global Administrator to perform these actions.
The first step is to install the Module using the below command:
Install-Module -Name ExchangeOnlineManagement
Next command will be:
Set-ExecutionPolicy RemoteSigned
Next command will be:
Import-Module ExchangeOnlineManagement
Next command will be:
Set-ExecutionPolicy RemoteSigned
Next command will be:
$UserCredential = Get-Credential
Enter Global Administrator credentials.
And the last command will be:
Connect-ExchangeOnline
Enter Global Administrator credentials and you are in