4

我正在尝试使用 PowerShell 通过 wsman 连接连接到 Exchange 服务器。有问题的客户端服务器位于工作组中,而 Exchange 服务器位于其自己的域中。

我使用以下命令尝试连接到服务器:

connect-wsman -connectionuri http://servername/PowerShell -credential domain\administrator

然后我得到完整的错误:

连接到远程服务器失败并显示以下错误消息: WinRM 客户端无法处理请求。它无法确定来自目标计算机的 HTTP 响应的内容类型。内容类型不存在或无效。有关详细信息,请参阅 about_Remote_Troubleshooting 帮助主题。

以前,当有问题的客户端服务器与 Exchange 服务器位于同一域中时,此方法有效。防火墙已关闭,所有服务器都是 WinRM 的 TrustedHosts。

有趣的是,当我使用:

connect-wsman -computername servername -credential domain\administrator

我没有收到任何错误。但是,我需要能够使用 URI 而不是计算机名。

有任何想法吗?

4

1 回答 1

0

New-PSSession要在交换服务器上工作,我对我的交换服务器使用另一种方法并Import-PSSession在本地加载远程交换功能

$PSExchSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "http://$($Exch.dNSHostName)/PowerShell/" -Credential (Get-CredentialByRegistry "$AD\Administrateur") -Authentication Kerberos
Import-PSSession $PSExchSession -CommandName 'Get-Mailbox','Get-MailboxStatistics','Get-ActiveSyncDeviceStatistics' -AllowClobber
于 2018-07-26T08:50:26.463 回答