Connecting to Exchange Online with remote PowerShell from a Mac

Yes! it is finally possible to connect to Exchange Online from PowerShell installed on MacOS. I noticed some tweets about this being possible on Linux earlier in the week so I thought I’d re-visit testing it on MacOS. PowerShell remoting has been available in the MacOs version since powershell-6.0.0-alpha.15, but it didn’t include the ability to specify a “ConnectionUri’ as the endpoint – it only worked with server names and IP addresses. powershell-6.0.0-alpha.17 which was recently released now includes this functionality.

The first thing you need to do it download and install the latest release from here, you’ll want to download at least powershell-6.0.0-alpha.17

Screen Shot 2017-03-15 at 3.47.08 PM

Next launch PowerShell and confirm the version:

$PSVersionTable

Screen Shot 2017-03-15 at 4.31.53 PM

We are now ready to run establish our remote session. First let’s define our credentials:

$UserCredential = Get-Credential

Then create the session:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri <a href="https://outlook.office365.com/powershell-liveid/">https://outlook.office365.com/powershell-liveid/</a> -Credential $UserCredential -Authentication Basic -AllowRedirection

And finally, import that session:

Import-PSSession $Session

Screen Shot 2017-03-15 at 4.41.16 PM

Once connected you have all the Exchange Online cmdlets available to you:

Screen Shot 2017-03-15 at 4.46.02 PM

I haven’t thoroughly tested it yet, but I look forward to spending some time using it soon!

Share this?Print this pageEmail to someoneTweet about this on TwitterShare on LinkedInShare on FacebookDigg thisGoogle+Pin on PinterestShare on StumbleUponShare on Redditshare on TumblrBuffer this pageFlattr the author

Post navigation


Comments

  • Martin

    Thank you very much! At last i can leave MS totally 🙂 Works perfectly!!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>