To execute PowerShell cmdlets to perform the required operations in Exchange Online environment, it is imperative to connect Exchange Online PowerShell. Mentioned below is a sample script to connect to your Exchange Online organization using PowerShell; username and password of an account with relevant permissions must be entered for successful connection.
$password = ConvertTo-SecureString "********" -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential
("USERNAME@DOMAIN.onmicrosoft.com", $password)
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
https://outlook.office365.com/powershell-liveid/ -Credential $Cred -Authentication Basic -AllowRedirection
Import-PSSession $Session -AllowClobber
#Always make sure to remove PSSession
Remove-PSSession $Session
The need to connect Exchange Online PowerShell to your session arises only to manage and report on Exchange Online environment using PowerShell. But there's an option to manage not just Exchange Online organizations but also AD, Office 365, Exchange Server, and more without having to download Microsoft Exchange Online PowerShell module - ADManager Plus.
ADManager Plus, a unified AD, Office 365 and Exchange management and reporting solution, enables you to manage and report on multiple platforms from a single console, with completely GUI-based, scripting free actions. It also offers purpose-built management features and reports to cater to every important aspect of AD, Office 365 and Exchange management and reporting. There is absolutely no need to import Exchange Online PowerShell module, connect Exchange Online PowerShell or connect to Office 365 PowerShell from your machine to manage Exchange Online organizations.
Advantages of ADManager Plus over PowerShell
In fact, these built-in management features allow you to manage objects and accounts in multiple platforms, in bulk, with purely GUI-based actions.
Simultaneously provision mailboxes in both Exchange and Office 365 with ADManager Plus.
Get 30-day free trial.For AD User Management
For AD User Reporting
For GPO Management
For Password Management
For AD Group Management
For File Access Management
For AD Computer Management
For Office 365 Management
For Exchange Management
For Microsoft Graph PowerShell
Entra ID user management
Entra ID reporting
Entra ID group management and reporting
Entra ID domain management
Entra ID contact management and reporting
Other Entra ID tasks
For Azure AD PowerShell
Entra ID user management
Entra ID reporting
Entra ID group management
Entra ID group reporting
Entra ID domain management
Entra ID contact management and reporting
Other Entra ID tasks