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.

  1. Open up Powershell
  2. Then type “Set-ExecutionPolicy RemoteSigned”
  3. Ensure TLS 1.2 is used with Powershell Gallery via this command “Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12”
  4. Verify WinRM is enabled with “winrm get winrm/config/client/auth”
    1. if needed, enable WinRM via “winrm quickconfig”
      1. 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)
  5. Then type “Install-Module -Name ExchangeOnlineManagement”
    1. type this to check the current version “Import-Module ExchangeOnlineManagement; Get-Module ExchangeOnlineManagement”
      1. If needed run this to update the module “Update-Module -Name ExchangeOnlineManagement”
        1. to confirm it is updated, type the same command after updating “Import-Module ExchangeOnlineManagement; Get-Module ExchangeOnlineManagement”
  6. Then type “Import-Module ExchangeOnlineManagement” to import the module
  7. Then type “Connect-ExchangeOnline -UserPrincipalName [email protected]
    1. Enter your password and MFA when prompted

If problems are found, refer to this documentation: Connect to Exchange Online PowerShell | Microsoft Learn

Cheers!

-Trevor