Exchange Online Powershell on macOS
Just tried this all on macOS 12.0.1 (Monterey) and it was all fine. The only difference was that (a) Homebrew moaned that Xcode was out of date, so that needed a 12gb update, and (b) Powershell moaned about using stuff from an untrusted repository. In the end I trusted PSGallery by using:
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted
In fact the only real issue was the horrific shade of yellow that the highlighting decided to use for cmdlet names!
A while ago, I ‘eugh-ed' over the steps required to get remote powershell working even in Windows. I think back then this would never have worked on macOS, but here we are, a little less than a year later, and I’ve for some reason got it working on macOS Big Sur.
The scenario was - as you would expect little less - somewhat convoluted. I was trying to configure Room Lists in Exchange Online which - is easy to create a Room Mailbox in Exchange Admin, but they are not usable unless you can then connect via remote powershell and enable room lists. Bit of a facepalm, obvs.
So when faced with this, I was reminded that some time ago I cleaned up my mac, which meant squirreling away my now mostly unused Windows VMs. I couldn’t bring myself to move 3ft to my right to get my storage disk, so instead set about trying to get Powershell on macOS working. It wasn’t too bad, but I did disappear down a bit of a rabbit hole when I hit an issue with OMI. I’ll spare you the drama.
So here’s what you do. This is on macOS Big Sur latest (11.2.1 at time of writing.) It does assume you have homebrew installed. It’s mostly join the dots, so if you get issues along the way, just do what you’re told. You will get warnings about untrusted galleries - you make a call on whether this is OK to you.
- brew install powershell
- brew install openssl
You may get
Warning: email@example.com 1.1.1g is already installed and up-to-date To reinstall 1.1.1g, run `brew reinstall firstname.lastname@example.org`
which is OK.
Also, consider running:
to add OpenSSL to your environment vars.
Install-Module -Name PowerShellGet (source)
Install-Module -Name ExchangeOnlineManagement
Install-Module -Name PSWSMan
sudo pwsh -Command ‘Install-WSMan'
This should disappear off to your browser to prompt for authentication.
But that was it, mostly.
Updated on 25/10/2021 following some comments / fixes - thanks!