Created: 1/24/23
Updated: 1/24/23
Something I use often is connecting to Exchange Online. Wanted to provide the method used to administer via Powershell.
- Open up Powershell
- Then type “Set-ExecutionPolicy RemoteSigned”
- Ensure TLS 1.2 is used with Powershell Gallery via this command “Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12”
- Verify WinRM is enabled with “winrm get winrm/config/client/auth”
- if needed, enable WinRM via “winrm quickconfig”
- If the value is not “true”, run this “winrm set winrm/config/client/auth ‘@{Basic=”true”}'” (denote single quote before double quote at the end)
- if needed, enable WinRM via “winrm quickconfig”
- Then type “Install-Module -Name ExchangeOnlineManagement”
- type this to check the current version “Import-Module ExchangeOnlineManagement; Get-Module ExchangeOnlineManagement”
- If needed run this to update the module “Update-Module -Name ExchangeOnlineManagement”
- to confirm it is updated, type the same command after updating “Import-Module ExchangeOnlineManagement; Get-Module ExchangeOnlineManagement”
- If needed run this to update the module “Update-Module -Name ExchangeOnlineManagement”
- type this to check the current version “Import-Module ExchangeOnlineManagement; Get-Module ExchangeOnlineManagement”
- Then type “Import-Module ExchangeOnlineManagement” to import the module
- Then type “Connect-ExchangeOnline -UserPrincipalName someone@domain.suffix”
- Enter your password and MFA when prompted
If problems are found, refer to this documentation: Connect to Exchange Online PowerShell | Microsoft Learn
Cheers!
-Trevor