Connect to Office 365 (Exchange Online) with PowerShell.

Опубликовано: 14 Март 2026
на канале: Adam W
3,758
6

How to connect to Office 365 Exchange with PowerShell! If you need to run Exchange commands for Office 365 follow this tutorial as the first step to connecting.

The Commands Are:

Set-ExecutionPolicy RemoteSigned

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powersh... -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session

To disconnect just run: Remove-PSSession $Session