Step 1:
The first thing you need to do is to install ExchangeOnlineManagement module for PowerShell.
Install-Module -Name ExchangeOnlineManagement -RequiredVersion 3.1.0
Installation logs..
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this
repository, change its InstallationPolicy value by running the Set-PSRepository
cmdlet. Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
(default is "N"):y
Installing package 'ExchangeOnlineManagement…
Step 2
Now let's connect to ExchangeOnlineManagement,
Connect-ExchangeOnline
This shall open up the web browser and ask you to log in to your Office.com account.

Once you Authenticate (may require MFA if enabled) you will see this message.
Authentication complete. You can return to the application. Feel free to close this browser tab.
And you should get a message on the console.
Let's see if we are connected to ExchangeOnline,
PS /Users/c2ctechtv> Get-OrganizationConfig | Format-Table -Auto Name, ServicePlan, TenantGuid
Name ServicePlan TenantGuid
---- ----------- ----------
code2care-xx.onmicrosoft.com BPOS_S_E15_0_Slim
If you want to disconnect with ExchangeOnline, run the below on the PowerShell Terminal.
Disconnect-ExchangeOnline
-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to Powershell,
- PowerShell: How to Check if a Module is Already Installed
- PowerShell: How to Write Output to a File
- PowerShell: Steps to Connect to connect to Exchange Online
- PowerShell Fix: Get-Help cannot find the Help files for this cmdlet on this computer
- PowerShell Traditional For Loop Example
- How to Run PowerShell Script as Administrator (Elevate)
- Update Powershell Using Command Line
- How to delete a file using PowerShell [Windows/macOS]
- PowerShell: Grep Command Alternative - Select-String
- PowerShell Concatenate String Examples
- How to add Sleep to PowerShell Script
- Connect Azure AD (Active Directory) for PowerShell
- How to Open PowerShell on Mac?
- List of PowerShell Function Commands for Mac
- How to Connect to Azure AD Account using PowerShell on Mac
- Download Google Chrome setup exe file using PowerShell
- Set Environment Variable in PowerShell for Mac
- How to switch to Powershell on Mac Terminal
- How to add sleep in Powershell Script
- PowerShell on Mac: The term get-service is not recognized as a name of a cmdlet, function, script file, or executable program
- How to Identify installed PowerShell version
- How to check PowerShell version
- How to install PowerShell on Mac using Brew
- PowerShell Switch Statement with Examples
- PowerShell ISE Alternative for Mac
More Posts:
- [Android Studio] Hardcoded string Button, should use @string resource - Android-Studio
- Python ternary operator (known as Conditional Expression) Example - Python
- [Fix] Docker Error response from daemon: manifest for :latest not found: manifest unknown - Docker
- How to enable, create and use Virtual Breakout Rooms in Microsoft Teams - Teams
- Top 10 emerging breakthrough trending technologies - HowTos
- Graph API error when querying BookingBusinesses - ErrorExceededFindCountLimit, The GetBookingMailboxes request returned too many results - Microsoft
- Notepad++ do not show CRLF characters - NotepadPlusPlus
- Clone a particular remote brach using git clone command - Git