Set up the SharePoint Online Management Shell environment

Download and install the following:

  • Open the shell
For example, Connect-SPOService -Url https://letsExchange-admin.sharepoint.com -credential admin@letsexchange.in
  • Url is the URL of the SharePoint Online Administration Center.
  • Credential is the user name of global admin .
Try it out! For example, run Get-SPOSite to get a list of all sites

Source : https://technet.microsoft.com/en-us/library/fp161372.aspx