If you have an account in Office 365 (even if there is no license assigned to it), using that account you can connect to Office 365 using PowerShell. The operations or cmdlets that you can execute vary depending on the permissions and licenses assigned to that account.
PowerShell cmdlets for Office 365 use the following pattern:
<Verb>-Msol<noun>
For example, take a look at this:
Get-MsolUser
Here, MSOL = Microsoft Online.
To find out about all the commands, use Get-Command *Msol*.
Once the connection is established successfully, let's create a new user account. To create the user account, the account that we will be using needs to be part of the global administrator role or the user management role.