Install the following components on your system to connect to your Office 365 tenant using PowerShell:

Microsoft Online Service Sign-in Assistant for IT Professionals RTW
Select the appropriate version of your OS

You must be a tenant administrator (i.e. comany administrator, global administrator) to successfully establish a connection to your Office 365 tenant using PowerShell. Read here how to assign an admin role in Office 365.

You’re now ready to connect to your Office 365 tenant using PowerShell!

  • To do so, run the Windows PowerShell console as administrator
  • Enter the following PowerShell commands:
    Import-Module MsOnline
    Connect-MsolService
  • PowerShell prompts for you Office 365 tenant credentials.
    2014-12-23_114924

You’re all set. Start managing your Office 365 tenant using this great overview of the Azure AD cmdlets.