O365 Powershell CLI

Needed to connect to O365 when my account has MFA enabled.

New computer, so here’s the full setup.

Using Internet Explorer or Edge, open your ECP/EAC (Admin of Exchange) portal page on your O365 account.
Click on Hybrid
Click on Configure
This installs a clickonce app for the Exchange Online powershell module.

Open PowerShell as an Administrator
winrm quickconfig
Enable per the wizard
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'

Now connect to your O365 system
Open PowerShell (the exchange-based one from the first steps)

Connect-EXOPSSession -UserPrincipalName yourusername@yourdomain.tld
If prompted, sign in

Leave a Reply

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