macOS 通过 PowerShell 连接 Microsoft Online 遇到的问题

Image for post
Image for post

首先说明下,问题最终并没有被完美解决,参见下面的 Issue

[Can not connect to Office 365 / Exchange Online with PowerShell · Issue #5561 · PowerShell/PowerShell]

[Powershell WSman broken due to OpenSSL 1.0 dependency · Issue #78085 · Homebrew/homebrew-cask]


1. 按照微软官方提供的步骤在 macOS 安装 PowerShell,我这边是通过 Homebrew 安装的

[在 macOS 上安装 PowerShell — PowerShell]

2. 我这边的话,还需要用到 AzureAD,所以我也安装了相应的工具


3. 然后安装登录工具

Install-Module MSOnline

4. 安装完毕后直接新建 session 连接,我这边的话,用的是世纪互联的

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic -AllowRedirection

5. 但是遇到的问题就是

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.
Image for post
Image for post

这个问题目前除了降级 OpenSSL 到 1.0,并没有什么解决方法。由于我担心降级后对其他功能造成影响,我自己就没继续操作下去了,只能不了了之,老老实实用 Windows 的 PowerShell 进行管理。

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store