How to Install Exchange Online PowerShell Module

Managing email communication processes can be a real challenge for medium and big-sized businesses.

Although Microsoft Exchange offers different management features, streamlining and managing administrative tasks is easier by using the Exchange Online PowerShell Module.

The Exchange Online PowerShell Module allows administrators to easily manage Exchange Online Environments using command lines.

In this blog post, we’ll simplify the installation process so you can learn how to install Exchange Online PowerShell module by following five quick steps.

Benefits of Installing the Exchange Online PowerShell Module

The Exchange Online PowerShell module allows administrators to manage their environments more easily, efficiently, and effectively.

Although it is possible to use the Exchange Admin Center (EAC) to manage Exchange Online, using the PowerShell module brings way more advantages and benefits to administrators, such as the following:

  1. Helps you in bulk-data retrieval scenarios and allows you to create mailboxes in bulk just by using cmdlets on PowerShell.
  2. It allows you to automate tasks that would otherwise be time-consuming, such as the creation of new users or the deletion of Microsoft Exchange Online objects.
  3. If things don’t go as planned, the PowerShell Module can help you with bug fixes by identifying what’s wrong with a certain mailbox or account.

What Do You Need for Connecting to Exchange Online PowerShell?

In order to install PowerShell and connect to the Online Module, there’s a series of requirements that must be met beforehand:

  1. A Microsoft Office 365 account with valid Exchange Licenses enabled.
  2. An Exchange Administrator Role and valid credentials to access the Office 365 account.
  3. A computer running Windows 7 or later.
  4. The latest PowerShell version installed (7.3.6).

How to Install Exchange Online PowerShell Module

To install the Exchange Online PowerShell module, we are going to use PowerShell cmdlets.

The process consists of enabling execution policies to run scripts, installing the PowerShell module, and then connecting to Exchange Online PowerShell V3. These are the five steps we need to follow.

Step 1: Set Windows PowerShell Execution Policy

We can’t install PowerShell scripts by default – this is the default behavior of PowerShell.

Therefore, we need to set the execution policy that will allow us to subsequently install Exchange Online PowerShell.

Open PowerShell on your computer, and let’s sign the execution policy, which, in theory, protects you from scripts that you don’t trust.

To set Execution Policy in PowerShell, use the following command:

Set-ExecutionPolicy RemoteSigned

After implementing the command line, close and relaunch this PowerShell Window for the changes to take effect.

Now, we are going to install the PowerShellGet module on our system.

If, by any chance, you believe that the module is already installed, you can check it out by using the following cmdlet:

Get-InstalledModule -Name ExchangeOnlineManagement

If the module hasn’t been installed before, you will see a message that says, “No match was found for the specified search criteria.

In this case, move on to the following step to continue with the installation process.

Step 2: Set Up PowerShellGet Module

Now, we are going to set up the PowerShellGet module, which is the previous step to connecting to Exchange Online.

To execute these cmdlets, it is necessary to run PowerShell as an Administrator.

Type PowerShell on Windows search, right-click on the PowerShell icon, and select “Run as Administrator.

Afterward, use the following command and press enter:

Install-Module PowershellGet -Force

A message will pop up asking you for the newest NuGet Provider version. The exact message is the following:

“​​PS C:\> Install-Module PowershellGet -ForceNuGet provider is required to continuePowerShellGet requires NuGet provider version ‘2.8.5.201’ or newer to interact with NuGet-based repositories. The NuGet provider must be available in ‘C:\Program Files\PackageManagement\ProviderAssemblies’ or’C:\Users\administrator.EXOIP\AppData\Local\PackageManagement\ProviderAssemblies’. You can also install the NuGet provider by running ‘Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force’. Do you want PowerShellGet to install and import the NuGet provider now?[Y] Yes  [N] No  [S] Suspend  [?] Help (default is “Y”): Y

You will be prompted to install NuGet Provider, so press Y and then Enter to install the latest NuGet Provider version.

Likewise, you may be asked to install the NuGet Provider from an untrusted repository – select “Yes” as this is entirely safe to do.

After using the import module cmdlet, it’s time to get our hands into the Exchange Online PowerShell module using the install-module cmdlet.

Step 3: Install the Exchange Online Management module

For this step, we are using the install-module cmdlet to finish the installation of the module after all permissions have been previously granted.

Open PowerShell again, and run the following command:

Install-Module -Name ExchangeOnlineManagement

After running the command, the installation of the module will begin.

Keep in mind that the installation will take a few minutes, depending on the speed of your Internet connection, so wait for a few minutes and move on to the fourth step.

Step 4: Connect to Exchange Online PowerShell V3

Finally, after the module has been installed, it’s time to connect to Exchange Online PowerShell V3.

To do this, go to the PowerShell window, and run the following command:

Connect-ExchangeOnline -UserPrincipalName admin@mail.com

The Connect-ExchangeOnline cmdlet will prompt you to sign into your Office account. Remember to replace admin@mail.com with the principal name of your administrator account before running the cmdlet.

Afterward, a sign-in window will appear. Here, simply type in your credentials in order to access your Exchange account.

If multi-factor authentication is enabled, you will need to type in the verification code for the current user account in order to continue.

Once you have successfully logged into the Exchange Online Module, you will receive the following message:

This V3 EXO PowerShell module contains new REST API backed Exchange Online cmdlets which doesn’t require WinRM for Client-Server communication. You can now run these cmdlets after turning off WinRM Basic Auth in your client machine thus making it more secure.Unlike the EXO* prefixed cmdlets, the cmdlets in this module support full functional parity with the RPS (V1) cmdlets.V3 cmdlets in the downloaded module are resilient to transient failures, handling retries and throttling errors inherently.However, REST backed EOP and SCC cmdlets are not available yet. To use those, you will need to enable WinRM Basic Auth.

This indicates that the connection to the Exchange Online PowerShell module has been successful.

It also means that, as you can see, you don’t need basic authentication in order to manage Exchange Online V3, as it supports certificate-based authentication (connecting to PowerShell after basic authentication is deprecated).

Alternatively, you can also download and install the module from the PowerShell Gallery (more info about the PowerShell Gallery here).

Step 5: Use Commands Available in the Exchange Online Environment

You have now installed and connected to the Exchange Online PowerShell module.

The Exchange Online Service allows you to run a series of rich cmdlets that allow you to perform otherwise time-consuming tasks within a few minutes or seconds.

This is a quick overview of the most important and used commands available in the Exchange Online PowerShell module:

CommandExplanation
Set-MailboxAllows you to modify a mailbox that already exists.
Remove-MailboxLet’s you delete a mailbox if necessary.
Get-MailboxRetrieve mailbox information and set mailbox permissions if needed.
Get-MailboxstatisticsReturns information about the number of messages in a mailbox.
Get-RecipientShow information about a recipient, such as recipient type and email address.
New-MailboxCreate an entirely new mailbox as requested.

In order to make the best out of the Exchange Online PowerShell module, make sure to check out these three relevant tips:

  1. Explain your PowerShell Script with comments before running it to keep track of the task.
  2. If you want to connect to the module faster, try disabling multi-factor authentication to accelerate the connection process.
  3. Keep the Exchange Online PowerShell Module updated – you can do this by running the following command on PowerShell: “Update-Module -Name “ExchangeOnlineManagement.

How to Disconnect Remote PowerShell Session

After finishing with the Exchange Online Management module, you’ll typically want to disconnect the session in order to use a different tenant or free up resources.

To disconnect from your current PowerShell session, run the following command:

Disconnect-ExchangeOnline

Running this command will remove the access token from the cache and local files, which allows you to start a brand-new session the next time you connect to the Exchange Online PowerShell module.

17 thoughts on “How to Install Exchange Online PowerShell Module

  1. helloI really like your writing so a lot share we keep up a correspondence extra approximately your post on AOL I need an expert in this house to unravel my problem May be that is you Taking a look ahead to see you

  2. Your blog is a treasure trove of valuable insights and thought-provoking commentary. Your dedication to your craft is evident in every word you write. Keep up the fantastic work!

  3. I simply could not go away your web site prior to suggesting that I really enjoyed the standard info a person supply on your guests Is going to be back incessantly to investigate crosscheck new posts

  4. Normally I do not read article on blogs however I would like to say that this writeup very forced me to try and do so Your writing style has been amazed me Thanks quite great post

  5. I do agree with all the ideas you have introduced on your post They are very convincing and will definitely work Still the posts are very short for newbies May just you please prolong them a little from subsequent time Thank you for the post

  6. What i do not realize is in fact how you are no longer actually much more wellfavored than you might be right now Youre very intelligent You recognize thus considerably in relation to this topic made me in my view believe it from numerous numerous angles Its like men and women are not fascinated until it is one thing to do with Lady gaga Your own stuffs excellent All the time handle it up

  7. My admiration for your creations is as substantial as your own sentiment. The visual presentation is tasteful, and the written content is sophisticated. Yet, you seem uneasy about the possibility of presenting something that may cause unease. I’m confident you’ll be able to resolve this issue efficiently.

  8. Fantastic site Lots of helpful information here I am sending it to some friends ans additionally sharing in delicious And of course thanks for your effort

  9. I loved as much as you will receive carried out right here The sketch is attractive your authored material stylish nonetheless you command get got an impatience over that you wish be delivering the following unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike

  10. Thank you for the auspicious writeup It in fact was a amusement account it Look advanced to more added agreeable from you By the way how could we communicate

  11. certainly like your website but you need to take a look at the spelling on quite a few of your posts Many of them are rife with spelling problems and I find it very troublesome to inform the reality nevertheless I will definitely come back again

  12. helloI really like your writing so a lot share we keep up a correspondence extra approximately your post on AOL I need an expert in this house to unravel my problem May be that is you Taking a look ahead to see you

  13. Simply wish to say your article is as amazing The clearness in your post is just nice and i could assume youre an expert on this subject Well with your permission let me to grab your feed to keep updated with forthcoming post Thanks a million and please carry on the gratifying work

  14. Hi i think that i saw you visited my web site thus i came to Return the favore Im attempting to find things to enhance my siteI suppose its ok to use a few of your ideas

  15. certainly like your website but you need to take a look at the spelling on quite a few of your posts Many of them are rife with spelling problems and I find it very troublesome to inform the reality nevertheless I will definitely come back again

  16. Hello Neat post Theres an issue together with your site in internet explorer would check this IE still is the marketplace chief and a large element of other folks will leave out your magnificent writing due to this problem

Leave a Reply

Your email address will not be published. Required fields are marked *

RELATED POST

PowerShell: Connect to Office 365 (Step by Step Guide)

Step 1: Install Required PowerShell Modules Before you can connect to Office 365 you first need to install the required…