How To Connect To Exchange Online Powershell

How To Articles

Connecting to Exchange Online PowerShell allows you to manage your Exchange Online environment using powerful command-line tools. As someone who frequently works with Exchange Online, I have found that connecting to PowerShell provides me with greater control and flexibility. In this article, I will guide you through the process of connecting to Exchange Online PowerShell step by step.

Step 1: Install the Required Software

The first step is to install the necessary software on your computer. We need to install the following items:

  • Windows PowerShell
  • Microsoft Online Services Sign-in Assistant
  • Exchange Online Remote PowerShell Module

You can download and install these software packages from the official Microsoft website. Ensure that you download the correct version for your operating system.

Step 2: Launch Windows PowerShell

Once you have installed the required software, launch Windows PowerShell. You can do this by searching for “PowerShell” in the Start menu or by pressing the Windows key + X and selecting “Windows PowerShell” from the menu.

Step 3: Connect to Exchange Online PowerShell

Now that you have PowerShell open, it’s time to connect to Exchange Online. Run the following command:

Connect-ExchangeOnline -UserPrincipalName [email protected]

Replace [email protected] with your own Office 365 user account. You will be prompted to enter your password. After providing the correct credentials, you will be connected to Exchange Online PowerShell.

Step 4: Run PowerShell Commands

With PowerShell connected to Exchange Online, you can now run various commands to manage your Exchange environment. Here are a few examples:


The above command retrieves a list of all mailboxes in your Exchange Online environment.

New-Mailbox -UserPrincipalName [email protected] -Name John Doe

This command creates a new mailbox with the specified user principal name and display name.

Feel free to explore and experiment with different PowerShell commands to accomplish specific tasks in your Exchange Online environment.


Connecting to Exchange Online PowerShell is a straightforward process that provides you with powerful tools to manage your Exchange Online environment. By following the steps outlined in this article, you can easily connect to Exchange Online PowerShell and start taking advantage of its capabilities. Happy managing!