The correct way to connect to Office 365 using PowerShell

Every time I’m sitting at a new computer and try to connect to Office 365 using PowerShell I normally have forgotten how.

I google for it and often the top result is either old information or just doesn’t work.

Some instructions ask you to install things like the Azure online services and Microsoft Online Services Sign in assistant.. some of which say you need higher versions of one installed and you try to install the newer version of the other it tells you a newer version is already installed.

I’ve found the best place to start is this set of documentation but also make sure you have run this command first:
Set-ExecutionPolicy RemoteSigned
(Note that you need to run powershell as an administrator to set this!)

Single Factor Authentication Admins:

New URL:

Old URL:

Old Old URL (now dead link):

The ExecutionPolicy commands followed by the connection commands from the above address worked fine on a stock Windows 8.1 computer without installing any extra programs!


Multiple factor authenctication enabled admin accounts:

Install Exchange Online Management:

Install-Module -Name ExchangeOnlineManagement



Import-Module ExchangeOnlineManagement</p>
Connect-ExchangeOnline -ShowProgress $true -UserPrincipalName youradmin@emailaddress

Disconnect with


This entry was posted in Uncategorized. Bookmark the permalink.

Comment on this topic

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s