Powershell 使用Connect WSMan会产生错误:它无法确定来自目标计算机的HTTP响应的内容类型
我正在尝试使用PowerShell通过wsman连接连接到Exchange服务器。所涉及的客户端服务器位于工作组中,而Exchange服务器位于其自己的域中 我使用以下命令尝试连接到服务器:Powershell 使用Connect WSMan会产生错误:它无法确定来自目标计算机的HTTP响应的内容类型,powershell,exchange-server,powershell-remoting,winrm,Powershell,Exchange Server,Powershell Remoting,Winrm,我正在尝试使用PowerShell通过wsman连接连接到Exchange服务器。所涉及的客户端服务器位于工作组中,而Exchange服务器位于其自己的域中 我使用以下命令尝试连接到服务器: connect-wsman -connectionuri http://servername/PowerShell -credential domain\administrator 然后我得到完整的错误: 连接到远程服务器失败,错误消息如下:WinRM客户端无法处理该请求。它无法确定来自目标计算机的HTT
connect-wsman -connectionuri http://servername/PowerShell -credential domain\administrator
然后我得到完整的错误:
连接到远程服务器失败,错误消息如下:WinRM客户端无法处理该请求。它无法确定来自目标计算机的HTTP响应的内容类型。内容类型不存在或无效。有关更多信息,请参阅关于远程故障排除帮助主题
以前,当所涉及的客户机服务器与Exchange服务器位于同一域中时,这种方法就起作用了。防火墙已关闭,所有服务器都是WinRM的受信任主机
有趣的是,当我使用:
connect-wsman -computername servername -credential domain\administrator
我没有得到任何错误。但是,我需要能够使用URI而不是计算机名
有什么想法吗?要在exchange server上工作,我使用另一种方法将
新建PSSession
加载到我的exchange server,并使用导入PSSession
本地加载远程exchange功能
$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
这个问题应该是关于ServerFault的。我也会试试ServerFault。这个问题也出现在我的C#代码中,这就是它最初发布在这里的原因。这个URI是什么意思“-connectionuri”?对于WSMAN,您应该使用