拥有MFA时使用Windows Powershell ISE for Exchange

问题描述 投票:1回答:2

我已经使用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模块并通过该模块连接并运行任何交换命令。我曾尝试在windows powerShell ISE中使用Connect-EXOPSSession cmdlet,但它不了解cmdlet

enter image description here enter image description here

powershell exchange-server powershell-remoting
2个回答
3
投票

要使用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 [email protected]

0
投票

我为了导入Exchange Online模块而遇到以下问题,允许您使用New-ExoPSSession进行连接

Import-Module $((Get-ChildItem -Path $($env:LOCALAPPDATA+"\Apps\2.0\") -Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse ).FullName|?{$_ -notmatch "_none_"}|select -First 1)
© www.soinside.com 2019 - 2024. All rights reserved.