Last active
January 11, 2024 12:51
-
-
Save OlafD/95caa302a89155c065b559df68deda8b to your computer and use it in GitHub Desktop.
Connect to Office 365 Exchange Online with PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($cred -eq $null) | |
{ | |
$cred = Get-Credential | |
} | |
Write-Host "Connecting to Exchange Online" | |
$exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $cred -Authentication Basic -AllowRedirection | |
Import-PSSession $exchangeSession | Out-Null | |
Write-Host "Connected to Exchange Online" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment