> ## Content Index
> Fetch the complete content index at: https://www.techielass.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Install Exchange Online PowerShell modules
- URL: https://www.techielass.com/install-exchange-online-powershell-modules/
- Published: 2022-07-19T07:01:00.000Z
- Updated: 2024-12-20T13:45:22.000Z
- Description: Join me as I look at how to install the latest Exchange Online PowerShell modules on your local computer and start to interact with your Exchange environment.
- Author: Sarah Lean
- Tags: Exchange Online, Microsoft Exchange, PowerShell

Do you need to connect to Exchange Online to manage features or even work on a migration? This is where the Exchange Online PowerShell module can help you. This blog post will guide you through the installation process and provide a step-by-step overview of utilizing its components for seamless integration and efficient operations.

## Install PowerShellGetModule

Open your PowerShell window or [Windows Terminal](https://www.techielass.com/install-windows-terminal-with-windows-package-manager/) session as Administrator. Now run the command:

```powershell
Install-Module PowershellGet -Force

```

If you are asked to install the NuGet provider, press **Y** and then **Enter**.

## Install Exchange Online Management Module

We can now install the Exchange Online Management module. To do this, we run the command: 

```powershell
Install-Module -Name ExchangeOnlineManagement

```

If asked, press **Y** and then **Enter**.

![Windows Terminal with PowerShell command history](https://storage.ghost.io/c/08/96/08960c71-63a2-449b-91b1-8d4628166dd2/content/images/2022/07/exchangepowershell.PNG)

Windows Terminal with PowerShell command history

## Connect to Exchange Online PowerShell V2

Now that everything is installed, it's time to interact with Exchange Online via PowerShell. 

Issue the command: 

```powershell
Connect-ExchangeOnline -UserPrincipalName admin@domain.com

```

Enter an email address that has permissions to interact with your Exchange setup. A pop-up or sign-in window will open; you may be required to enter your username and password and approve a sign-in via your multi-factor authentication (MFA) app. 

After the verification, the [PowerShell](https://www.techielass.com/tag/powershell/) window will display a banner showing new commands and any information. If you don't want to see that banner, you can use this command to connect to Exchange Online: 

```powershell
Connect-ExchangeOnline -UserPrincipalName admin@domain.com -ShowBanner:$false

```

## Disconnect Exchange Online

It's essential to disconnect the remote PowerShell session when you’re finished. If you close the Exchange Online PowerShell Module window without disconnecting the session, you will still be seen as using a remote PowerShell session, and that's not the best practice. 

If you issue the following command:

```powershell
Disconnect-ExchangeOnline

```

It will clean up session objects and local files and remove the access token from the cache. 

![Windows Terminal with PowerShell command history](https://storage.ghost.io/c/08/96/08960c71-63a2-449b-91b1-8d4628166dd2/content/images/2022/07/exchangedisconnect.png)

Windows Terminal with PowerShell command history