How to Connect to Office 365 using PowerShell (Aug 2018)

In the last few years, I have written a few articles about how to connect to Office 365 using PowerShell however during the years things have changed and it is time to write a new post about this.

History

The first Office 365 PowerShell module that was released was MSONLINE and was known as V1, the second Office 365 module was called AZUREAD.

When the second module was released there was a plan to move all cmdlets from MSONLINE to AZUREAD, however, this never happened and until today both modules are needed to fully manage Office 365 using PowerShell.

Today, I will show you how to install both of the module and have the ability to manage Office 365 completely.

Get Started

To install the MSONLINE version 1 module you will need to download the Microsoft Online Services Sign-In Assistant and install it on your machine.

https://www.microsoft.com/en-us/download/details.aspx?id=41950

Install Module

Once the sign-in assistant is installed I will go ahead and install the two modules directly from PowerShell using the two cmdlets.

install-Module MSOnline
Install-module azuread

Once Installed I can connect to Office 365 using one of the two cmdlet below.

Connect-Azuread
Connect-MsolService

Conclusion

As it looks the old MSONLINE module will stay with us for years to come however Microsoft keeps making the installation process of modules much easier and simple.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.