已解决:连接到outlook.office365.com失败
当您使用 PowerShell 连接到 Exchange Online 时,您可能会遇到“访问被拒绝”错误消息:
New-PSSession : [outlook.office365.com] Connecting to remote server outlook.office365.com failed with the following error message :
Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
At line:2 char:12
+ $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed
Import-PSSession : Cannot validate argument on parameter 'Session'. The argument is null. Provide a valid value for the argument,
and then try running the command again.
At line:3 char:18
+ Import-PSSession $Session -DisableNameChecking
+ ~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Import-PSSession], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.ImportPSSessionCommand
此错误消息通常是由以下三个问题之一引起的:
- 您输入的用户名或密码无效
- 您没有适当的权限/角色
- 您正在使用旧的 EXO 模块
通过检查 Office 365 中的凭据和角色分配,可以轻松解决第一个问题和第二个问题。
第三个问题的解决方案是使用EXO V2模块连接到Exchange Online。
使用以下命令安装 EXO V2:
Install-Module ExchangeOnlineManagement安装 EXO V2 模块后,您可以使用以下命令通过 MFA 连接到 Exchange Online:
Connect-ExchangeOnline如何从 Active Directory 管理 Exchange Online 邮箱
Easy365Manager 是 Active Directory 用户和计算机的管理单元,允许您直接从 AD 用户属性管理 Office 365 许可证和邮箱。
使用 Easy365Manager,您不再需要使用 PowerShell 或多个 Office 365 Web 控制台来管理 Office 365。
Easy365Manager 管理单元使您可以直接从 AD 用户和计算机访问 Office 365 许可证和邮箱管理:
使用这些新选项卡,您可以执行 Office 365 邮箱管理,而无需离开 AD 用户和计算机。
您甚至可以执行通常只能通过 PowerShell 执行的任务,例如配置日历权限:
查看完整的功能列表,了解 Easy365Manager 将如何整合您的 AD 和 Office 365 管理并允许您删除本地 Exchange Server。
您可以在此处下载功能齐全的 30 天试用版,无风险地试用 Easy365Manager。


