Connecting PowerShell to Azure (Office 365)

  1. First install the Microsoft Online Services Sign-In Assistant for IT Professionals RTW from the Microsoft Download Center. Then install the Azure Active Directory Module for Windows PowerShell (64-bit version), and click Run to run the installer package.
  2. Before you can run any of the cmdlets discussed in this article, you must first connect to your online service. To do so, run the cmdlet connect-msolservice at the Windows PowerShell command prompt. You will then be prompted for your credentials. If you want, you can supply your credentials in advance, for example:
    $msolcred = get-credential
    connect-msolservice -credential $msolcred