powershell - 拥有 MFA 时使用 Windows Powershell ISE for Exchange

标签 powershell exchange-server powershell-remoting

我使用 Windows PowerShell ISE 已经有一段时间了,成功连接到 Azure AD、Exchange 和 SharePoint。最近组织发生了变化,所以我们现在使用 MFA 和交换,我跟着这个 https://technet.microsoft.com/en-us/library/mt775114(v=exchg.160).aspx一切都按预期工作。

我的问题是 - 现在有没有办法使用 Windows PowerShell ISE 来运行交换命令?

现在看来我需要打开 Exchange Online 远程 PowerShell 模块并通过该模块连接和运行任何交换命令。我试过使用 Connect-EXOPSSession Windows powerShell ISE 中的 cmdlet,但它不理解 cmdlet

enter image description here
enter image description here

最佳答案

要将 Exchange Online 与 MFA 连接,您需要安装 Microsoft 的 Exchange Online PowerShell 模块 (EXO)。

您可以从 Exchange 管理中心下载 EXO。

安装 EXO 后,在 Windows Powershell ISE 中执行以下注释,

$MFAExchangeModule = ((Get-ChildItem -Path $($env:LOCALAPPDATA+"\Apps\2.0\") -Filter CreateExoPSSession.ps1 -Recurse ).FullName | Select-Object -Last 1)
#Importing Exchange MFA Module 
  . "$MFAExchangeModule" 
  Connect-EXOPSSession -UserPrincipalName Admin@Contoso.com

关于powershell - 拥有 MFA 时使用 Windows Powershell ISE for Exchange,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44968435/

相关文章:

asp.net - 无法加载文件或程序集 'Microsoft.Exchange.WebServices, Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

java - 使用 MS Exchange 服务器从 java 发送邮件,导致连接超时

powershell - 位置参数问题

powershell - Invoke-Command 和直接查询的区别

json - ConvertFrom-JSON 不返回记录

arrays - 如何使用 Powershell 简化多维数组?

html - DotAll 和多行正则表达式

c# - Exchange Web 服务收件箱文件夹正文搜索不起作用

powershell - 将 scriptblock 作为参数传递给 powershell 中的 Invoke-Command scriptblock

powershell - powershell-从阵列问题中获取特定信息