How to connect to Office 365 with PowerShell



As an Administrator for Office 365, you can use PowerShell to manage a lot of your administrative tasks such as user management and domain management.

The following is needed:

  1. MS Online Services Assistant needs to be downloaded and installed
  2. MS Online Module for PowerShell needs to be  downloaded and installed
  3. Connect to Microsoft Online in PowerShell
    Download MS Online Services Assistant

Download the OS version needed:

      Download Online Module for PowerShell

    Download the OS version needed:

        Connect to MS Online in PowerShell

      Open a PowerShell session and import the MS Online Module using:

      Import-Module MsOnline


      Connect with your Microsoft Online tenant account using:



      Use your tenant account e.g.

        Now you are ready to work with PowerShell against your Office 365 account. If you need a list of the cmdlets available, see the reference documentation link below or run the following PowerShell command:

      Get-Command -Module MsOnline



        Reference documentation:

      About Author

      Peter is an Exchange specialist with over 15+ years of experience with Exchange Server and certified Microsoft Certified Master (MCM) and Microsoft Certified Solutions Master (MCSM) on Exchange Server. He has been awarded the Microsoft MVP award, every year since 2007. He is active in the Microsoft community and User Group Leader for CoLabora (a danish UC & Cloud User Group). He works as an Cloud & Infrastructure Architect and Consulent, with primary focus on Exchange, Office 365, Azure and Skype for Business.


      Copyright 2005-2015 - Peter Schmidt.