Connect to Exchange Online PowerShell From MacOS

Affan Javid
1 min readJun 26, 2020
Photo by Mikaela Wiedenhoff on Unsplash
PS /Users/userone> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection New-PSSession: This parameter set requires WSMan, and no supported WSMan client library was found. WSMan is either not installed or unavailable for this system.

Quick answer ! Reason behind this problem is openssl version on MacOS . pwsh need openssl v 1.0. We need to reinstall openssl using home brew.

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/64555220bfbf4a25598523c2e4d3a232560eaad7/Formula/openssl.rb -f

Home Brew in MacOS BigSur is broken and unable to install the Openssl 1.0.2 install and to solve this Mac Ports can be used to install Openssl 1.0

sudo port selfupdate sudo port upgrade outdated sudo port install openssl10

some cases may need to update the symbolic links

sudo mkdir -p /usr/local/opt/openssl sudo ln -s /opt/local/lib /usr/local/opt/openssl/lib

That’s it . now open the Exchange Online PowerShell using

$UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session -DisableNameChecking

To Disconnect Enter

#Close Session Remove-PSSession $Session

Originally published at https://affan.info on June 26, 2020.

--

--

Affan Javid

IT Infrastructure Specialist , Open-source enthusiast